Explain about Hibernate-Mapping element ?

#1
The main element of hbm file is <hibernate-mapping> element

- This element has no.of optional attributes.

1. The schema and catalog attributes specify that tables referred to in this mapping belong to the named schema and/or catalog. If specified, tablenames will be qualified by the given schema and catalog names. If missing, tablenames will be unqualified.

2. The default-cascade attribute specifies what cascade style should be assumed for properties and Collections which do not specify a cascade attribute.

3. The auto-import attribute is used for unqualified class names in the query language.

Syntax of Hibernate-Mapping Element :
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"

/>

1. schema (optional) : The name of a Database schema.

2. catalog (optional) : The name of a Database catalog.

3. default-cascade (optional - defaults value none) : A default cascade style.

4. default-access (optional - defaults value property) : The strategy Hibernate should use for accessing all properties. Can be a custom implementation of PropertyAccessor.

5. default-lazy (optional - defaults value true) : The default value for unspecifed lazy attributes of class and collection mappings.

6. auto-import (optional - defaults value true) : Specifies whether we can use unqualified class names (of classes in this mapping) in the query language.

7. package (optional) : Specifies a package prefix to assume for unqualified class names in the mapping document.
 
#2
The main element of hbm file is <hibernate-mapping> element

- This element has no.of optional attributes.

1. The schema and catalog attributes specify that tables referred to in this mapping belong to the named schema and/or catalog. If specified, tablenames will be qualified by the given schema and catalog names. If missing, tablenames will be unqualified.

2. The default-cascade attribute specifies what cascade style should be assumed for properties and Collections which do not specify a cascade attribute.

3. The auto-import attribute is used for unqualified class names in the query language.

Syntax of Hibernate-Mapping Element :
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"

/>

1. schema (optional) : The name of a Database schema.

2. catalog (optional) : The name of a Database catalog.

3. default-cascade (optional - defaults value none) : A default cascade style.

4. default-access (optional - defaults value property) : The strategy Hibernate should use for accessing all properties. Can be a custom implementation of PropertyAccessor.

5. default-lazy (optional - defaults value true) : The default value for unspecifed lazy attributes of class and collection mappings.

6. auto-import (optional - defaults value true) : Specifies whether we can use unqualified class names (of classes in this mapping) in the query language.

7. package (optional) : Specifies a package prefix to assume for unqualified class names in the mapping document.
Hello Mr Rao,
I m new in this form
I would like to ask can i write one hbm file for many persistence class

Regards,
Gyanendra
 
Top