Package org.hibernate.annotations
Annotation Type Bag
-
@Target({METHOD,FIELD,ANNOTATION_TYPE}) @Retention(RUNTIME) public @interface Bag
Specifies that an attribute of typeList
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
orListIndexBase
.