Package io.dropwizard.hibernate
Annotation Type UnitOfWork
-
@Target(METHOD) @Retention(RUNTIME) @Documented @Repeatable(UnitsOfWork.class) public @interface UnitOfWork
When annotating a Jersey resource method, wraps the method in a Hibernate session.To be used outside Jersey, one need to create a proxy of the component with the annotated method.
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description org.hibernate.CacheMode
cacheMode
TheCacheMode
for the session.org.hibernate.FlushMode
flushMode
TheFlushMode
for the session.boolean
readOnly
Iftrue
, the Hibernate session will default to loading read-only entities.boolean
transactional
Iftrue
, a transaction will be automatically started before the resource method is invoked, committed if the method returned, and rolled back if an exception was thrown.String
value
The name of a hibernate bundle (session factory) that specifies a datasource against which a transaction will be opened.
-
-
-
-
value
String value
The name of a hibernate bundle (session factory) that specifies a datasource against which a transaction will be opened.- Default:
- "hibernate"
-
-