B.2. org.hibernate.annotations

B.2.1. @org.hibernate.annotations.AnyMetaDef

Applies onto to properties. Used by Hibernate to captures the semantics for an "any" (polymorphic) relationship. See for more details on using this annotation.

The above notwithstanding, the @AnyMetaDef annotation is captured in the Naked Objects metamodel, but not otherwise used by Naked Objects.

B.2.2. @org.hibernate.annotations.CollectionOfElements

Applies only to collections. Used by JPA/Hibernate to allow collections of elements to be persisted in a separate table.

For Naked Objects, it determines:

The class of the collection is potentially usable by Naked Objects viewers (eg to return a table of objects instead of a simple list of their titles).

B.2.3. @org.hibernate.annotations.Entity

Applies to classes. The Hibernate annotation captures some additional semantics not in the JPA spec.

For Naked Objects, the @org.hibernate.annotations.Entity annotation determines:

  • immutability; @org.hibernate.annotations.Entity(mutable=false) implies the class is immutable (cf @org.nakedobjects.applib.annotation.Immutable annotation)

See also the JPA specific annotation, Section B.1.5, “@javax.persistence.Entity.

B.2.4. @org.hibernate.annotations.Immutable

Applies to classes and to properties. Used by JPA/Hibernate "to make some minor performance optimizations" (it probably does not bother to wrap in proxies).

More significantly, for Naked Objects it determines:

  • on a class, that it is immutable (cf @org.nakedobjects.applib.annotation.Immutable annotation)

  • on a property, that it is disabled (cf @org.nakedobjects.applib.annotation.Disabled annotation)