Hibernate

adplus-dvertising
Mapping In Hibernate
Previous Home Next

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"                       
 />

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 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 inheritance with Machine.hbm.xml.

Previous Home Next