Annotation 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.

See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    org.hibernate.CacheMode
    The CacheMode for the session.
    org.hibernate.FlushMode
    The FlushMode for the session.
    boolean
    If true, the Hibernate session will default to loading read-only entities.
    boolean
    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.
    The name of a hibernate bundle (session factory) that specifies a datasource against which a transaction will be opened.
  • Element Details

    • readOnly

      boolean readOnly
      If true, the Hibernate session will default to loading read-only entities.
      See Also:
      • Session.setDefaultReadOnly(boolean)
      Default:
      false
    • transactional

      boolean transactional
      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.
      Default:
      true
    • cacheMode

      org.hibernate.CacheMode cacheMode
      The CacheMode for the session.
      See Also:
      • CacheMode
      • Session.setCacheMode(CacheMode)
      Default:
      NORMAL
    • flushMode

      org.hibernate.FlushMode flushMode
      The FlushMode for the session.
      See Also:
      • FlushMode
      • org.hibernate.Session#setFlushMode(org.hibernate.FlushMode)
      Default:
      AUTO
    • value

      String value
      The name of a hibernate bundle (session factory) that specifies a datasource against which a transaction will be opened.
      Default:
      "hibernate"