We can found the serval optional attributes. In the hibernate mapping file we found the schema and catalog attributes that specify that tables referred to in the hibernate mapping belong to the named schema and/or catalog. When we specify to both then tablenames will be qualified by the given schema and cattalog names. When we missing to identyfing to tablenames will be unqualified. The default-cascade attribute specifies what cascade style should be assumed for properties and collections that do not specify a cascade attribute.we found the bydefault auto-import attribute allows that use to unqualified class names in the query languages.
Here we can understand in the below code:
<hibernate-mapping
schema="schemaName"
catalog="catalogName"
default-cascade="cascade_style"
default-access="field|property|ClassName"
default-lazy="true|false"
auto-import="true|false"
package="package.name"
/>
Tag |
Descripton |
schema(optional) |
Database name is schema |
catalog(optional) |
Name of the database catalog. |
Default-cascade(optional) |
It is by default none It shows a default cascade style. |
Default-access(optional) |
It is by default on property. It is used to accessing the all properties. It can be a custom PropertyAccessor. |
Default-lazy(optional) |
It is by default true. It is used to unspecified the lazy attributes of class and collection mapping |
Auto-import(optional) |
It is by default ture. We can specifies or we can use unqualified class name of classes in this mapping in the query language. |
package(optional) |
It specifies the package prefix to use the unqualified class name in the mapping document. |
When we have two persistence class with the same unqualified name, the we need to set auto-import="false". Then we see the an exception result if we attempt to assign two classes to the same "imported" name.
In the Hinernate mapping element allwos to nest serval persistent <class> mapping, as we given above. When we need to map a single persistence class then we found the single class hierchy in one mapping file and name it after the persistent class. We can take for the example Robot.hbm.xml,Vechile.hbm.xml of if we using the hibernate inhertance with Machine.hbm.xml.