Defining Association Collection Type for One-to-many or Many-to-many Associations

You define association collection type for one-to-many or many-to-many associations as follows:

  1. Open the association property sheet and click the Detail tab.
  2. Specify a Multiplicity on both sides.
  3. Specify either unidirectional or bi-directional navigability.
  4. Specify role names if necessary.
  5. If one role of the association is navigable and the multiplicity is many, you can set the collection container type and batch loading size.
  6. If you select java.util.List or <none>, it implies that you want to use an array or list-indexed collection type. Then you should define an index column to preserve the objects collection order in the database.

Note: The Java collection container type conditions the Hibernate collection type.

Collection Container Type

Hibernate Collection Type

<None>

array

java.util.Collection

bag or idbag (many-to-many)

java.util.List

list

java.util.Set

set