Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package io.dropwizard.hibernate;
 
 
 
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

When annotating a Jersey resource method, wraps the method in a Hibernate session.

See also:
UnitOfWorkRequestDispatcher
public @interface UnitOfWork {
    
If true, the Hibernate session will default to loading read-only entities.

See also:
org.hibernate.Session.setDefaultReadOnly(boolean)
    boolean readOnly() default false;

    
If true, 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.
    boolean transactional() default true;

    
The CacheMode for the session.

See also:
CacheMode
org.hibernate.Session.setCacheMode(CacheMode)
    CacheMode cacheMode() default .;

    
The FlushMode for the session.

See also:
FlushMode
org.hibernate.Session.setFlushMode(org.hibernate.FlushMode)
    FlushMode flushMode() default .;
New to GrepCode? Check out our FAQ X