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.
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 collection (cf
@org.nakedobjects.applib.TypeOf
annotation)
the fetch type (see Section B.1.6, “@javax.persistence.FetchType
”).
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).
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
”.
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)