Annotation Interface Bag


Specifies that an attribute of type 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 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 OrderColumn or ListIndexBase.