In Hibernate we found some component tag which is used for mapping. The <component> element maps to properties of a child object of the columns of the table of a parent class. We know that component can declare their own properties.
Example:
<component
name="propertyName"
class="className"
insert="true|false"
update="true|false"
access="field|property|ClassName"
lazy="true|false"
optimistic-lock="true|false"
unique="true|false"
node="element-name|." >
<property ...../> <many-to-one .... /> ........ </component>
Tag |
Description |
name |
It shows the property name. |
class(optional) |
It found defaults to the property type of determined by reflection. It use the name of the componant(child) class. |
insert |
It is used to mapped column appear in SQL INSERTs |
update |
It is used to mapped columns appear in the SQL UPDAE |
access(optional) |
It found the property defaults. In this strategy Hibernate uses for accessing the property value. |
lazy(optional) |
It defaults to false. It specifies the componant should be fetched lazily when the instance variable is first accessed. It requries build-time bytecode instrumentation. |
optimistic-lock(optional) |
It defaults to true. It specifices that updates to this componant either do or do not require acquisition of the optimistic lock. It determines if a version increment should occur when this property is dirty. |
unique(optional) |
It found the defaults to false. It specifies that a unique constraint exists upon all mapped columns of the componant. |