Top Description Methods
org.hibernate.annotations

public @Interface Bag

extends Annotation
Annotations
@Target:METHOD, FIELD, ANNOTATION_TYPE
@Retention:RUNTIME
Imports
java.lang.annotation.Retention, .Target

Specifies that an attribute of type java.util.List is semantically a bag, that is, that the order of the list elements is not significant, and should not be persistent.

This annotation is not necessary, and has no effect, unless the configuration property hibernate.mapping.default_list_semantics is set to org.hibernate.metamodel.CollectionClassification#LIST. However, its use is still encouraged, since the explicit annotation serves as useful documentation.

API Note

This annotation causes an exception if the attribute is also annotated jakarta.persistence.OrderColumn or ListIndexBase.

Author
Steve Ebersole

Method Summary

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString