Hibernate O/R Mappings So far we have seen very basic O/R
mapping using hibernate but there are three most important
mapping topics which we have to learn in detail. These are the
mapping of collections, the mapping of associations between
entity classes and Component Mappings. If an entity or class has
collection of values for a particular variable, then we can map
those values using any one of the collection interfaces
available in java. Hibernate can persist instances of
java.util.Map, java.util.Set, java.util.SortedMap,
java.util.SortedSet, java.util.List, and any array of persistent
entities or values. |Collection type||Mapping and Description|
|java.util.Set||This is mapped with a <set> element and
initialized with java.util.HashSet| |java.util.SortedSet||This
is mapped with a <set> element and initialized with
java.util.TreeSet. The sort attribute can be set to either a
comparator or natural ordering.| |java.util.List||This is mapped
with a <list> element and initialized with java.util.ArrayList|
|java