@Target(value={METHOD,TYPE}) @Retention(value=RUNTIME) public @interface Transactional
EntityManager from
Strix.em().
If annotated on a class, all public methods without NoTransaction and Transactional will relate to
the options defined in that annotation. If annotated on a method it will override the Transactional
annotation of the class.
| Modifier and Type | Optional Element and Description |
|---|---|
Class<? extends Throwable>[] |
noRollbackFor
Defines expected exceptions, for which strix will not do a rollback
|
String |
persistenceUnit
Defines the persistence unit, i.e. which database connection should be used.
|
boolean |
readOnly
Prevent the method from doing updates to the database, i.e. only read allowed
|
boolean |
requiresNew
Defines, that the method will create and use its own transaction, i.e. it will create a new transaction whenever
the method is called.
|
int |
timeout
Defines the time in milliseconds, after which the
EntityTransaction will be rollbacked
and the EntityManager will be closed. |
public abstract String persistenceUnit
public abstract boolean readOnly
true, if the transaction should only be readable and not writeable. Otherwise false.public abstract boolean requiresNew
true, if a new transaction is required. Otherwise falseCopyright © 2017–2018. All rights reserved.