HIBERNATE TUTORIAL

HIBERNATE - Hibernate O/R Mapping

<hibernate-mapping> element

The root element of hibernate mapping document is <hibernate-mapping> element. This element has several optional attributes. 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. The default-cascade attribute specifies what cascade style should be assumed for properties and Collections which do not specify a cascade attribute. The auto-import attribute lets us use unqualified class names in the query language, by default.

<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)
(2)
(3)
(4)
(5)
(6)
(7)
/> 

 

(1) schema (optional): The name of a database schema.
(2) catalog (optional): The name of a database catalog.
(3) default-cascade (optional - defaults to none): A default cascade style.
(4) default-access (optional - defaults to property): The strategy Hibernate should use for accessing all properties. Can be a custom implementation of PropertyAccessor.
(5) default-lazy (optional - defaults to true): The default value for unspecifed lazy attributes of class and collection mappings.
(6) auto-import (optional - defaults to 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.



Hibernate tutorial
Introduction to Hibernate
Overview of Hibernate
Features of Hibernate
Getting Started with Hibernate
Hibernate O/R Mapping

Mapping declaration

Mapping Document
<hibernate-mapping> element
<class> element
<id> element
<generator> element
<property> element
<many-to-one> element
<one-to-one> element
Hibernate Mapping In Depth
Hibernate Query Language
Hibernate Complete Example

Use of this website constitutes acceptance of the AllAppLabs.com Terms and Conditions