Sunday, August 31, 2008

Hibernate Types  in JAVA:

Hibernate types fall into three broad categories: entities, components, and values.

1.) Entities:

Generally, an entity is a POJO class that has been mapped into the database using the or elements. An entity can also be a dynamic map (actually a Map of Maps). These are mapped against the database in the same way as a POJO, but with the default entity mode of the SessionFactory set to dynamic-map.

2.) Components:

Lying somewhere between entities and values are component types. When the class representation is simple and its instances have a strong one-to-one relationship with instances of another class, then it is a good candidate to become a component of that other class.

3.) Values:

Everything that is not an entity or a component is a value. Generally, these correspond to the data types supported by your database, the collection types, and, optionally, some userdefined types.