Print
HibernateTags

@hibernate tags

@hibernate.any-column

Defines a column for the any type mapping

Unique

false

Allowed locations

class

method

constructor

field

false

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

name

true

Any value

 

no

 

The column name

unique-key

false

Any value

 

no

 

The name of a unique constraint

comment

false

Any value

 

no

 

comment for this column

check

false

Any value

 

no

 

A SQL expression used to generate a multi-row check constraint for automatic schema generation.

index

false

Any value

 

no

 

Name of database index

unique

false

true, false

 

no

 

defines inqueness status in database terms

not-null

false

true, false

 

no

 

Nullability status

precision

false

Any value

 

no

 

Precission.

length

false

Any value

 

no

 

Column length

sql-type

false

Any value

 

no

 

Specify sql type

scale

false

Any value

 

no

 

Scale.

@hibernate.any

An "any" association is a polymorphic association to any table with

the given identifier type. The first listed column is a VARCHAR column

holding the name of the class (for that row). This tag requires at least one

@hibernate.column, and may require use of @hibernate.meta and @hibernate.meta-value tags

Unique

true

Allowed locations

class

method

constructor

field

false

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

optimistic-lock

false

true, false

 

no

 

Specifies that updates to this property do or do not require acquisition of the optimistic lock.

In other words, define if a version increment should occur if this property is dirty.

lazy

false

true, false, proxy, no-proxy, extra

 

no

 

Lazyness. Lazy fetching may be completely disabled by setting lazy="false"

index

false

Any value

 

no

 

Name of database index

insert

false

true, false

 

no

 

Should the column appear in the SQL INSERT

node

false

Any value

 

no

 

Node definition.

update

false

true, false

 

no

 

Should the column appear in the SQL UPDATE

id-type

true

Any value

 

no

 

The identifier type of mapped entries.

access

false

Any value

 

no

 

The strategy Hibernate should use for accessing the property value.

cascade

false

Any value

 

no

 

Specifies which operations should be cascaded from the parent object to the associated object

meta-type

false

Any value

 

no

 

Specify a custom type that maps database column values to persistent

classes which have identifier properties of the type specified by id-type.

If the meta-type returns instances of java.lang.Class, nothing else is

required. On the other hand, if it is a basic type like string or

character, you must specify the mapping from values to classes.

@hibernate.array

defines array collection. @hibernate.key , @hibernate.index and collection element shall be specified

Unique

true

Allowed locations

class

method

constructor

field

false

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

element-class

false

Any value

 

no

 

specifies element class ( implied by type )

inverse

false

true, false

 

no

 

if this collection is inverse. Inverse mean that changes on this side of

association will not trigger database operations. in case fo bidirectional

many-to-many association one of the sides shall be declared as inverse to

prtevent strange databse behaviour. ( double inserts )

check

false

Any value

 

no

 

A SQL expression used to generate a multi-row check constraint for automatic schema generation.

subselect

false

Any value

 

no

 

aps an immutable and read-only entity to a database subselect. Useful if you want to have a view

instead of a base table, but don't.

outer-join

false

true, false, auto

 

no

 

Enable outer-join fetching

schema

false

Any value

 

no

 

Defines database schema

table

false

Any value

 

no

 

Defines database table

where

false

Any value

 

no

 

defines where clause to be used.

fetch

false

join, select, subselect

 

no

 

Chooses between outer-join fetching or sequential select fetching.

node

false

Any value

 

no

 

Node definition.

mutable

false

true, false

 

no

 

 

batch-size

false

Any value

 

no

 

Specifies batch size

access

false

Any value

 

no

 

The strategy Hibernate should use for accessing the property value.

cascade

false

Any value

 

no

 

Specifies which operations should be cascaded from the parent object to the associated object

catalog

false

Any value

 

no

 

The name of a database catalog.

collection-type

false

Any value

 

no

 

Collection type.

optimistic-lock

false

true, false

 

no

 

Collection: species that changes to the state of the collection results in increment of the owning entity's

version.(For one to many associations, it is often reasonable to disable this setting.)

embed-xml

false

true, false

 

no

 

If embed-xml="true", the default, the XML tree for the associated entity (or collection of value type)

will be embedded directly in the XML tree for the entity that owns the association. Otherwise, if

embed-xml="false", then only the referenced identifier value will appear in the XML for single point

associations and collections will simply not appear at all.

persister

false

Any value

 

no

 

Specifies a custom ClassPersister.

@hibernate.bag

Defines a collection with a bag semantic. It's like list, but does not need explicit

indexing column. This tag requires bag element definition.

Unique

true

Allowed locations

class

method

constructor

field

false

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

lazy

false

true, false, proxy, no-proxy, extra

 

no

 

Lazyness. Lazy fetching may be completely disabled by setting lazy="false"

order-by

false

Any value

 

no

 

Specify hibernate ordering. Optional, JDK1.4 only. Specify a table column (or columns) that define the

iteration order of the Map, Set or bag, together with an optional asc or desc.

inverse

false

true, false

 

no

 

if this collection is inverse. Inverse mean that changes on this side of

association will not trigger database operations. in case fo bidirectional

many-to-many association one of the sides shall be declared as inverse to

prtevent strange databse behaviour. ( double inserts )

check

false

Any value

 

no

 

A SQL expression used to generate a multi-row check constraint for automatic schema generation.

subselect

false

Any value

 

no

 

aps an immutable and read-only entity to a database subselect. Useful if you want to have a view

instead of a base table, but don't.

outer-join

false

true, false, auto

 

no

 

Enable outer-join fetching

schema

false

Any value

 

no

 

Defines database schema

table

false

Any value

 

no

 

Defines database table

where

false

Any value

 

no

 

defines where clause to be used.

fetch

false

join, select, subselect

 

no

 

Chooses between outer-join fetching or sequential select fetching.

node

false

Any value

 

no

 

Node definition.

mutable

false

true, false

 

no

 

 

batch-size

false

Any value

 

no

 

Specifies batch size

access

false

Any value

 

no

 

The strategy Hibernate should use for accessing the property value.

cascade

false

Any value

 

no

 

Specifies which operations should be cascaded from the parent object to the associated object

catalog

false

Any value

 

no

 

The name of a database catalog.

collection-type

false

Any value

 

no

 

Collection type.

optimistic-lock

false

true, false

 

no

 

Collection: species that changes to the state of the collection results in increment of the owning entity's

version.(For one to many associations, it is often reasonable to disable this setting.)

embed-xml

false

true, false

 

no

 

If embed-xml="true", the default, the XML tree for the associated entity (or collection of value type)

will be embedded directly in the XML tree for the entity that owns the association. Otherwise, if

embed-xml="false", then only the referenced identifier value will appear in the XML for single point

associations and collections will simply not appear at all.

persister

false

Any value

 

no

 

Specifies a custom ClassPersister.

@hibernate.cache

Enables caching

Unique

false

Allowed locations

class

method

constructor

field

true

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

region

false

Any value

 

no

 

Name of a cache region.

usage

true

transactional, read-write, nonstrict-read-write, read-only

 

no

 

Defines the cache semantics

@hibernate.class

Declare a persistent class

Unique

true

Allowed locations

class

method

constructor

field

true

false

false

false

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

optimistic-lock

false

none, dirty, version, all

 

no

 

 

polymorphism

false

explicit, implicit

 

no

 

Enable "explicit" polymorphism

lazy

false

true, false, proxy, no-proxy, extra

 

no

 

Lazyness. Lazy fetching may be completely disabled by setting lazy="false"

check

false

Any value

 

no

 

A SQL expression used to generate a multi-row check constraint for automatic schema generation.

select-before-update

false

true, false

 

no

 

Specifies that Hibernate should never perform an SQL UPDATE unless it is certain that an object

is actually modified. In certain cases (actually, only when a transient object has been associated

with a new session using update()), this means that Hibernate will perform an extra SQL SELECT to

determine if an UPDATE is actually required.

dynamic-update

false

true, false

 

no

 

Whether dynymic update is allowed

subselect

false

Any value

 

no

 

aps an immutable and read-only entity to a database subselect. Useful if you want to have a view

instead of a base table, but don't.

schema

false

Any value

 

no

 

Defines database schema

entity-name

false

Any value

 

no

 

Hibernate3 allows a class to be mapped multiple times (to different tables, potentially), and allows

entity mappings that are represented by Maps or XML at the java level. In these cases, you should

provide an explicit arbitrary name for the entity.

table

false

Any value

 

no

 

Defines database table

dynamic-insert

false

true, false

 

no

 

Whether dynamic insert is allowed

where

false

Any value

 

no

 

defines where clause to be used.

name

false

Any value

 

no

 

Specifies the name.

proxy

false

Any value

 

no

 

Specifies an interface to use for CGLIB proxies

rowid

false

Any value

 

no

 

Hibernate can use so called ROWIDs on databases which support. E.g. on Oracle, Hibernate

can use the rowid extra column for fast updates if you set this option to rowid. A ROWID is

an implementation detail and represents the physical location of a stored tuple.

node

false

Any value

 

no

 

Node definition.

mutable

false

true, false

 

no

 

 

batch-size

false

Any value

 

no

 

Specifies batch size

catalog

false

Any value

 

no

 

The name of a database catalog.

persister

false

Any value

 

no

 

Specifies a custom ClassPersister.

abstract

false

true, false

 

no

 

Used to mark abstract superclasses in <union-subclass> hierarchies.

discriminator-value

false

Any value

 

no

 

Specifies discriminator value. A value that distiguishes individual subclasses, used for

polymorphic behaviour. Acceptable values include null and not null.

@hibernate.collection-id

<collection-id> definition for <idbag>.

Unique

false

Allowed locations

class

method

constructor

field

true

true

true

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

column

true

Any value

 

no

 

Specifies database column. If not specified hibernate will guess based on property

name.

generator-class

true

Any value

 

no

 

Name of a generator class. All generators implement the interface <code>org.hibernate.id.IdentifierGenerator</code>.

There are names for the built-in generators:

<ul>

<li>increment</li>

<li>identity</li>

<li>sequence</li>

<li>hilo</li>

<li>seqhilo</li>

<li>seqhilo</li>

<li>uuid</li>

<li>guid</li>

<li>native</li>

<li>assigned</li>

<li>select</li>

<li>foreign</li>

</ul>

type

true

Any value

 

no

 

Specify hibernate type.

length

false

Any value

 

no

 

Column length

@hibernate.column

Customize column mapping.

Unique

false

Allowed locations

class

method

constructor

field

false

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

name

true

Any value

 

no

 

The column name

unique-key

false

Any value

 

no

 

The name of a unique constraint

comment

false

Any value

 

no

 

comment for this column

check

false

Any value

 

no

 

A SQL expression used to generate a multi-row check constraint for automatic schema generation.

index

false

Any value

 

no

 

Name of database index

unique

false

true, false

 

no

 

defines inqueness status in database terms

not-null

false

true, false

 

no

 

Nullability status

precision

false

Any value

 

no

 

Precission.

length

false

Any value

 

no

 

Column length

sql-type

false

Any value

 

no

 

Specify sql type

scale

false

Any value

 

no

 

Scale.

@hibernate.comment

represents comment which can be placed in various places into mapping this

tag does not define any parameters and contens will be used verbatim. this

tag replaces comment parameters found in various tags

Unique

true

Allowed locations

class

method

constructor

field

true

true

true

true

@hibernate.component

declare property to be hibernate component. A component is a user-defined class, persisted

along with its containing entity to the table of the entity class. JavaBeans

style properties of the component are mapped to columns of the table of the

containing entity.

Unique

false

Allowed locations

class

method

constructor

field

false

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

optimistic-lock

false

true, false

 

no

 

Specifies that updates to this component do or do not require acquisition of the optimistic lock.

In other words, determines if a version increment should occur when this property is dirty.

prefix

false

Any value

 

no

 

When multiple Java fields are of the same component datatype, use this to specify a descriminating

column-name-prefix. Properties that are included which have a @hibernate.property column="xxx"

attribute or @hibernate.column name="xxx" on the property will be prefixed.

lazy

false

true, false, proxy, no-proxy, extra

 

no

 

Lazyness. Lazy fetching may be completely disabled by setting lazy="false"

properties-name

false

Any value

 

no

 

Define what <properties> tag this property belongs to.

If attribute is absent it means that property does not belong to any propertis set.

insert

false

true, false

 

no

 

Should the column appear in the SQL INSERT

node

false

Any value

 

no

 

Node definition.

unique

false

true, false

 

no

 

defines inqueness status in database terms

join-name

false

Any value

 

no

 

Define what <join> tag this property belongs to.

If attribute is absent it means that property does not belong to any <join> tag.

update

false

true, false

 

no

 

Should the column appear in the SQL UPDATE

class

false

Any value

 

no

 

Specifies the class name.

access

false

Any value

 

no

 

The strategy Hibernate should use for accessing the property value.

@hibernate.composite-element

Declares a composite collection element

Unique

true

Allowed locations

class

method

constructor

field

false

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

class

true

Any value

 

no

 

Specifies the class name of composite element.

node

false

Any value

 

no

 

Node definition.

@hibernate.composite-id

Declares a composite-id. For a table with a composite key, you may map multiple properties of the class

as identifier properties. The <composite-id> element accepts <key-property> property mappings

and <key-many-to-one> mappings as child elements.

Unique

false

Allowed locations

class

method

constructor

field

false

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

unsaved-value

false

Any value

 

no

 

A value that distinguishes transient instances with existing persistent state from new transient instances

class

false

Any value

 

no

 

Specifies the class name.

access

false

Any value

 

no

 

The strategy Hibernate should use for accessing the property value.

@hibernate.composite-index

Composite index of a map ie. a map keyed on components.

Unique

false

Allowed locations

class

method

constructor

field

false

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

class

true

Any value

 

no

 

Component class name.

@hibernate.composite-key

Declares a composite collection element. Strictly specking this tag is not necessary in hibernate3 as it

will make a guess and produce some obscure column name for you. Collection key defined which column in

resulting table is to be used as reference to id of owner entity.

Unique

false

Allowed locations

class

method

constructor

field

true

false

false

false

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

class

true

Any value

 

no

 

The name of the element class

@hibernate.composite-map-key

Composite index of a map ie. a map keyed on components.

<composite-map-key> is preferred to <composite-index>

Unique

false

Allowed locations

class

method

constructor

field

true

true

true

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

class

true

Any value

 

no

 

Component class name.

@hibernate.discriminator-column

Declares column as child of key element

Unique

false

Allowed locations

class

method

constructor

field

true

true

true

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

name

true

Any value

 

no

 

The column name

unique-key

false

Any value

 

no

 

The name of a unique constraint

comment

false

Any value

 

no

 

comment for this column

check

false

Any value

 

no

 

A SQL expression used to generate a multi-row check constraint for automatic schema generation.

index

false

Any value

 

no

 

Name of database index

unique

false

true, false

 

no

 

defines inqueness status in database terms

not-null

false

true, false

 

no

 

Nullability status

precision

false

Any value

 

no

 

Precission.

length

false

Any value

 

no

 

Column length

sql-type

false

Any value

 

no

 

Specify sql type

scale

false

Any value

 

no

 

Scale.

@hibernate.discriminator

Defines a discriminator. Polymorphic data requires a column holding a class discriminator value. This

value is not directly exposed to the application.

Unique

false

Allowed locations

class

method

constructor

field

true

false

false

false

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

column

false

Any value

 

no

 

The name of the mapped database table column

force

false

true, false

 

no

 

do not know what it means.

formula

false

Any value

 

no

 

An arbitrary SQL expression that is executed when a type has to be evaluated. Allows content-based

discrimination.

insert

false

true, false

 

no

 

Should the column appear in the SQL INSERT

not-null

false

true, false

 

no

 

Nullability status

type

false

Any value

 

no

 

Specify hibernate type

length

false

Any value

 

no

 

Column length

@hibernate.element

Declares the element type of a collection of basic ( primitive ) type.

Unique

false

Allowed locations

class

method

constructor

field

false

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

type

true

Any value

 

no

 

The Hibernate type

formula

false

Any value

 

no

 

An arbitrary SQL expression that is executed when a type has to be evaluated. Allows content-based

discrimination.

node

false

Any value

 

no

 

Node definition.

unique

false

true, false

 

no

 

defines inqueness status in database terms

not-null

false

true, false

 

no

 

Nullability status

length

false

Any value

 

no

 

Column length

column

false

Any value

 

no

 

Specifies database column. If not specified hibernate will guess based on property name

@hibernate.filter-def

Top-level filter definition.

Unique

false

Allowed locations

class

method

constructor

field

true

false

false

false

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

name

true

Any value

 

no

 

Filter name

condition

false

Any value

 

no

 

Definition of a condition.

@hibernate.filter-param

Filter parameter definition.

Unique

false

Allowed locations

class

method

constructor

field

true

false

false

false

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

name

true

Any value

 

no

 

Filter parameter name.

type

true

Any value

 

no

 

Type of a filter parameter.

filterdef-name

false

Any value

 

no

 

Name of the filter-def which this parameter is applied

@hibernate.filter

Definition of a filter attached to a class or collection.

Unique

false

Allowed locations

class

method

constructor

field

true

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

name

true

Any value

 

no

 

Filter name.

condition

false

Any value

 

no

 

Definition of a condition.

@hibernate.formula

Formula an arbitrary SQL expression that is executed when a type has to be evaluated.

Unique

false

Allowed locations

class

method

constructor

field

false

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

value

false

Any value

 

no

 

Value of attribute

@hibernate.generator-param

If any parameters are required to configure or initialize the generator instance, they are

passed using the <param> element.

Unique

false

Allowed locations

class

method

constructor

field

false

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

name

true

Any value

 

no

 

Parameter name.

value

false

Any value

 

no

 

Parameter value.

@hibernate.id

Mapped classes must declare the primary key column of the database table. Most classes will also have a

JavaBeans-style property holding the unique identifier of an instance. The <id> element defines the

mapping from that property to the primary key column.

Unique

false

Allowed locations

class

method

constructor

field

false

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

generator-class

true

Any value

 

no

 

The key generator class. Hibernate recognizes standart generator

classes: "uuid.hex", "uuid.string", "increment", "assigned", "native", "identity", "sequence", "hilo", "seqhilo",

"foreign" ( See hibernate documentation for meaning of those ) as well as fully qualified name of custom generator

class

name

false

Any value

 

no

 

Specifies the name.

unsaved-value

false

Any value

 

no

 

A value that distinguishes transient instances with existing persistent state from new transient instances

node

false

Any value

 

no

 

Node definition.

type

false

Any value

 

no

 

Specify hibernate type

length

false

Any value

 

no

 

Column length

access

false

Any value

 

no

 

The strategy Hibernate should use for accessing the property value.

column

false

Any value

 

no

 

Specifies database column. If not specified hibernate will guess based on property name

@hibernate.idbag

Defines a idbag.

Unique

false

Allowed locations

class

method

constructor

field

true

true

true

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

lazy

false

true, false, proxy, no-proxy, extra

 

no

 

Lazyness. Lazy fetching may be completely disabled by setting lazy="false"

check

false

Any value

 

no

 

A SQL expression used to generate a multi-row check constraint for automatic schema generation.

subselect

false

Any value

 

no

 

aps an immutable and read-only entity to a database subselect. Useful if you want to have a view

instead of a base table, but don't.

outer-join

false

true, false, auto

 

no

 

Enable outer-join fetching

schema

false

Any value

 

no

 

Defines database schema

table

false

Any value

 

no

 

Defines database table

where

false

Any value

 

no

 

defines where clause to be used.

fetch

false

join, select, subselect

 

no

 

Chooses between outer-join fetching or sequential select fetching.

node

false

Any value

 

no

 

Node definition.

mutable

false

true, false

 

no

 

 

batch-size

false

Any value

 

no

 

Specifies batch size

access

false

Any value

 

no

 

The strategy Hibernate should use for accessing the property value.

cascade

false

Any value

 

no

 

Specifies which operations should be cascaded from the parent object to the associated object

catalog

false

Any value

 

no

 

The name of a database catalog.

collection-type

false

Any value

 

no

 

Collection type.

optimistic-lock

false

true, false

 

no

 

Collection: species that changes to the state of the collection results in increment of the owning entity's

version.(For one to many associations, it is often reasonable to disable this setting.)

embed-xml

false

true, false

 

no

 

If embed-xml="true", the default, the XML tree for the associated entity (or collection of value type)

will be embedded directly in the XML tree for the entity that owns the association. Otherwise, if

embed-xml="false", then only the referenced identifier value will appear in the XML for single point

associations and collections will simply not appear at all.

persister

false

Any value

 

no

 

Specifies a custom ClassPersister.

order-by

false

Any value

 

no

 

Specify hibernate ordering. Optional, JDK1.4 only. Specify a table column (or columns) that define the

iteration order of the Map, Set or bag, together with an optional asc or desc.

@hibernate.import

Suppose your application has two persistent classes with the same name, and you don't want to specify

the fully qualified (package) name in Hibernate queries. Classes may be "imported" explicitly, rather

than relying upon auto-import="true". You may even import classes and interfaces that are not explicitly

mapped.

Unique

false

Allowed locations

class

method

constructor

field

true

false

false

false

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

class

true

Any value

 

no

 

The fully qualified class name of of any Java class.

rename

false

Any value

 

no

 

A name that may be used in the query language.

@hibernate.index-column

declares column as child of index element

Unique

false

Allowed locations

class

method

constructor

field

false

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

name

true

Any value

 

no

 

The column name

unique-key

false

Any value

 

no

 

The name of a unique constraint

comment

false

Any value

 

no

 

comment for this column

check

false

Any value

 

no

 

A SQL expression used to generate a multi-row check constraint for automatic schema generation.

index

false

Any value

 

no

 

Name of database index

unique

false

true, false

 

no

 

defines inqueness status in database terms

not-null

false

true, false

 

no

 

Nullability status

precision

false

Any value

 

no

 

Precission.

length

false

Any value

 

no

 

Column length

sql-type

false

Any value

 

no

 

Specify sql type

scale

false

Any value

 

no

 

Scale.

@hibernate.index-many-to-any

Many to many association mapped to the key of a map ie. a map keyed on entities.

Unique

false

Allowed locations

class

method

constructor

field

true

true

true

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

id-type

true

Any value

 

no

 

The identifier type of mapped entries.

meta-type

false

Any value

 

no

 

Specify a custom type that maps database column values to persistent

classes which have identifier properties of the type specified by id-type.

If the meta-type returns instances of java.lang.Class, nothing else is

required. On the other hand, if it is a basic type like string or

character, you must specify the mapping from values to classes.

@hibernate.index-many-to-many

Declares many-to-many collection index. Will be used as map key for ternary associations. Shall be an entity

Unique

false

Allowed locations

class

method

constructor

field

false

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

class

true

Any value

 

no

 

Entity to be used as key in the ternary association maps

foreign-key

false

Any value

 

no

 

Declaration of column name for foreign key constraint

entity-name

false

Any value

 

no

 

Hibernate3 allows a class to be mapped multiple times (to different tables, potentially), and allows

entity mappings that are represented by Maps or XML at the java level. In these cases, you should

provide an explicit arbitrary name for the entity.

column

false

Any value

 

no

 

Specifies database column. If not specified hibernate will guess based on property name

@hibernate.index

Declares a collection index. This will be used as index for the arrays, sotring field for the lists or keys in the map

The <index> element is semi-deprecated in Hibernate3, <list-index> and <map-key> are preferred.

Unique

false

Allowed locations

class

method

constructor

field

false

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

node

false

Any value

 

no

 

Node definition.

type

false

Any value

 

no

 

Specify hibernate type

length

false

Any value

 

no

 

Column length

column

false

Any value

 

no

 

Specifies database column. If not specified hibernate will guess based on property name

@hibernate.jcs-cache

Enables caching

Unique

false

Allowed locations

class

method

constructor

field

true

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

usage

true

read-write, nonstrict-read-write, read-only

 

no

 

Defines the cache semantics

@hibernate.join-key

Using the <join-key> element, it is possible to map properties of one class to several tables.

Unique

false

Allowed locations

class

method

constructor

field

true

false

false

false

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

column

false

Any value

 

no

 

If enabled, Hibernate will insert a row only if the properties defined by this join are non-null

and will always use an outer join to retrieve the properties.

@hibernate.join

Using the <join> element, it is possible to map properties of one class to several tables.

Unique

false

Allowed locations

class

method

constructor

field

true

false

false

false

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

optional

false

true, false

 

no

 

If enabled, Hibernate will insert a row only if the properties defined by this join are non-null

and will always use an outer join to retrieve the properties.

table

true

Any value

 

no

 

The name of the joined table.

name

true

Any value

 

no

 

The name of the join

fetch

false

join, select, subselect

 

no

 

Chooses between outer-join fetching or sequential select fetching.

subselect

false

Any value

 

no

 

aps an immutable and read-only entity to a database subselect. Useful if you want to have a view

instead of a base table, but don't.

schema

false

Any value

 

no

 

Defines database schema

inverse

false

true, false

 

no

 

Should the column appear in the SQL UPDATE

catalog

false

Any value

 

no

 

The name of a database catalog.

@hibernate.joined-subclass-key

Declares a joined-subclass key

Unique

false

Allowed locations

class

method

constructor

field

true

false

false

false

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

column

false

Any value

 

no

 

Specifies database column. If not specified hibernate will guess based on property name

@hibernate.joined-subclass

Declare the current class as joined subclass

Unique

false

Allowed locations

class

method

constructor

field

true

false

false

false

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

check

false

Any value

 

no

 

A SQL expression used to generate a multi-row check constraint for automatic schema generation.

lazy

false

true, false, proxy, no-proxy, extra

 

no

 

Lazyness. Lazy fetching may be completely disabled by setting lazy="false"

select-before-update

false

true, false

 

no

 

Specifies that Hibernate should never perform an SQL UPDATE unless it is certain that an object

is actually modified. In certain cases (actually, only when a transient object has been associated

with a new session using update()), this means that Hibernate will perform an extra SQL SELECT to

determine if an UPDATE is actually required.

dynamic-update

false

true, false

 

no

 

Whether dynymic update is allowed

entity-name

false

Any value

 

no

 

Hibernate3 allows a class to be mapped multiple times (to different tables, potentially), and allows

entity mappings that are represented by Maps or XML at the java level. In these cases, you should

provide an explicit arbitrary name for the entity.

dynamic-insert

false

true, false

 

no

 

Whether dynamic insert is allowed

name

false

Any value

 

no

 

Specifies the name.

proxy

false

Any value

 

no

 

Specifies an interface to use for CGLIB proxies

node

false

Any value

 

no

 

Node definition.

batch-size

false

Any value

 

no

 

Specifies batch size

abstract

false

true, false

 

no

 

Used to mark abstract superclasses in <union-subclass> hierarchies.

persister

false

Any value

 

no

 

Specifies a custom ClassPersister.

subselect

false

Any value

 

no

 

aps an immutable and read-only entity to a database subselect. Useful if you want to have a view

instead of a base table, but don't.

schema

false

Any value

 

no

 

Defines database schema

catalog

false

Any value

 

no

 

The name of a database catalog.

table

false

Any value

 

no

 

Defines database table

@hibernate.key-column

Declares column as child of key element

Unique

false

Allowed locations

class

method

constructor

field

true

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

name

true

Any value

 

no

 

The column name

unique-key

false

Any value

 

no

 

The name of a unique constraint

comment

false

Any value

 

no

 

comment for this column

check

false

Any value

 

no

 

A SQL expression used to generate a multi-row check constraint for automatic schema generation.

index

false

Any value

 

no

 

Name of database index

unique

false

true, false

 

no

 

defines inqueness status in database terms

not-null

false

true, false

 

no

 

Nullability status

precision

false

Any value

 

no

 

Precission.

length

false

Any value

 

no

 

Column length

sql-type

false

Any value

 

no

 

Specify sql type

scale

false

Any value

 

no

 

Scale.

@hibernate.key-many-to-one

Define many-to-one key property

Unique

true

Allowed locations

class

method

constructor

field

false

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

name

false

Any value

 

no

 

Specifies the name.

lazy

false

true, false, proxy, no-proxy, extra

 

no

 

Lazyness. Lazy fetching may be completely disabled by setting lazy="false"

foreign-key

false

Any value

 

no

 

Declaration of column name for foreign key constraint

class

false

Any value

 

no

 

Specifies the class name.

position

false

Any value

 

no

 

Defines the key position in the xml configuration.

entity-name

false

Any value

 

no

 

Hibernate3 allows a class to be mapped multiple times (to different tables, potentially), and allows

entity mappings that are represented by Maps or XML at the java level. In these cases, you should

provide an explicit arbitrary name for the entity.

access

false

Any value

 

no

 

The strategy Hibernate should use for accessing the property value.

column

false

Any value

 

no

 

Specifies database column. If not specified hibernate will guess based on property name

@hibernate.key-property

Unique

true

Allowed locations

class

method

constructor

field

false

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

type

false

Any value

 

no

 

Specify hibernate type

length

false

Any value

 

no

 

Column length

position

false

Any value

 

no

 

Defines the key position in the xml configuration.

access

false

Any value

 

no

 

The strategy Hibernate should use for accessing the property value.

column

false

Any value

 

no

 

Specifies database column. If not specified hibernate will guess based on property name

@hibernate.key

Declares a collection key. Strictly specking this tag is not necessary, as hibernate

will make a guess and produce some obscure column name for you. Collection key defined which column in

resulting table is to be used as reference to id of owner entity.

Unique

false

Allowed locations

class

method

constructor

field

false

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

on-delete

false

cascade, noaction

 

no

 

Specifies whether the foreign key constraint has database-level cascade delete enabled.

foreign-key

false

Any value

 

no

 

Declaration of column name for foreign key constraint

property-ref

false

Any value

 

no

 

Specifies that the foreign key refers to columns that are not the primary key of the orginal table.

not-null

false

true, false

 

no

 

Nullability status

unique

false

true, false

 

no

 

defines inqueness status in database terms

update

false

true, false

 

no

 

Should the column appear in the SQL UPDATE

column

false

Any value

 

no

 

Specifies database column. If not specified hibernate will guess based on property name

@hibernate.list-index

Declare of a list-index tag for array or list. <list-index> is preferred to <index>.

Unique

true

Allowed locations

class

method

constructor

field

false

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

base

false

Any value

 

no

 

 

node

false

Any value

 

no

 

Node definition.

column

false

Any value

 

no

 

Specifies database column. If not specified hibernate will guess based on property name

@hibernate.list

Defines a List

Unique

true

Allowed locations

class

method

constructor

field

false

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

lazy

false

true, false, proxy, no-proxy, extra

 

no

 

Lazyness. Lazy fetching may be completely disabled by setting lazy="false"

order-by

false

Any value

 

no

 

Specify hibernate ordering. Optional, JDK1.4 only. Specify a table column (or columns) that define the

iteration order of the Map, Set or bag, together with an optional asc or desc.

inverse

false

true, false

 

no

 

if this collection is inverse. Inverse mean that changes on this side of

association will not trigger database operations. in case fo bidirectional

many-to-many association one of the sides shall be declared as inverse to

prtevent strange databse behaviour. ( double inserts )

check

false

Any value

 

no

 

A SQL expression used to generate a multi-row check constraint for automatic schema generation.

subselect

false

Any value

 

no

 

aps an immutable and read-only entity to a database subselect. Useful if you want to have a view

instead of a base table, but don't.

outer-join

false

true, false, auto

 

no

 

Enable outer-join fetching

schema

false

Any value

 

no

 

Defines database schema

table

false

Any value

 

no

 

Defines database table

where

false

Any value

 

no

 

defines where clause to be used.

fetch

false

join, select, subselect

 

no

 

Chooses between outer-join fetching or sequential select fetching.

node

false

Any value

 

no

 

Node definition.

mutable

false

true, false

 

no

 

 

batch-size

false

Any value

 

no

 

Specifies batch size

access

false

Any value

 

no

 

The strategy Hibernate should use for accessing the property value.

cascade

false

Any value

 

no

 

Specifies which operations should be cascaded from the parent object to the associated object

catalog

false

Any value

 

no

 

The name of a database catalog.

collection-type

false

Any value

 

no

 

Collection type.

optimistic-lock

false

true, false

 

no

 

Collection: species that changes to the state of the collection results in increment of the owning entity's

version.(For one to many associations, it is often reasonable to disable this setting.)

embed-xml

false

true, false

 

no

 

If embed-xml="true", the default, the XML tree for the associated entity (or collection of value type)

will be embedded directly in the XML tree for the entity that owns the association. Otherwise, if

embed-xml="false", then only the referenced identifier value will appear in the XML for single point

associations and collections will simply not appear at all.

persister

false

Any value

 

no

 

Specifies a custom ClassPersister.

@hibernate.loader

Defines loader.

Unique

false

Allowed locations

class

method

constructor

field

true

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

query-ref

true

Any value

 

no

 

Query reference definition.

@hibernate.many-to-any

Declares many-to-any type mapping

Unique

true

Allowed locations

class

method

constructor

field

false

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

id-type

true

Any value

 

no

 

The identifier type of mapped entries.

meta-type

false

Any value

 

no

 

Specify a custom type that maps database column values to persistent

classes which have identifier properties of the type specified by id-type.

If the meta-type returns instances of java.lang.Class, nothing else is

required. On the other hand, if it is a basic type like string or

character, you must specify the mapping from values to classes.

@hibernate.many-to-many

Many to many association. This tag declares the entity-class

element type of a collection and specifies a many-to-many relational model

Unique

true

Allowed locations

class

method

constructor

field

false

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

class

false

Any value

 

no

 

either this or entity-name parameter is required

fetch

false

join, select, subselect

 

no

 

Chooses between outer-join fetching or sequential select fetching.

foreign-key

false

Any value

 

no

 

Declaration of column name for foreign key constraint

formula

false

Any value

 

no

 

An arbitrary SQL expression that is executed when a type has to be evaluated. Allows content-based

discrimination.

unique

false

true, false

 

no

 

defines inqueness status in database terms

node

false

Any value

 

no

 

Node definition.

outer-join

false

true, false, auto

 

no

 

Enable outer-join fetching

not-found

false

exception, ignore

 

no

 

Specifies the not-found attribute.

entity-name

false

Any value

 

no

 

Hibernate3 allows a class to be mapped multiple times (to different tables, potentially), and allows

entity mappings that are represented by Maps or XML at the java level. In these cases, you should

provide an explicit arbitrary name for the entity.

column

false

Any value

 

no

 

Specifies database column. If not specified hibernate will guess based on property name

embed-xml

false

true, false

 

no

 

If embed-xml="true", the default, the XML tree for the associated entity (or collection of value type)

will be embedded directly in the XML tree for the entity that owns the association. Otherwise, if

embed-xml="false", then only the referenced identifier value will appear in the XML for single point

associations and collections will simply not appear at all.

@hibernate.many-to-one

Declares a many-to-one association. An ordinary association to another persistent class is declared using

a many-to-one element. The relational model is a many-to-one association: a foreign key in one table is

referencing the primary key column(s) of the target table.

Unique

true

Allowed locations

class

method

constructor

field

false

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

lazy

false

true, false, proxy, no-proxy, extra

 

no

 

Lazyness. Lazy fetching may be completely disabled by setting lazy="false"

formula

false

Any value

 

no

 

An arbitrary SQL expression that is executed when a type has to be evaluated. Allows content-based

discrimination.

insert

false

true, false

 

no

 

Should the column appear in the SQL INSERT

unique

false

true, false

 

no

 

defines inqueness status in database terms

join-name

false

Any value

 

no

 

Define what <join> tag this property belongs to.

If attribute is absent it means that property does not belong to any <join> tag.

update

false

true, false

 

no

 

Should the column appear in the SQL UPDATE

outer-join

false

true, false, auto

 

no

 

Enable outer-join fetching

class

false

Any value

 

no

 

Specifies the class name.

not-found

false

exception, ignore

 

no

 

Specifies the not-found attribute.

entity-name

false

Any value

 

no

 

Hibernate3 allows a class to be mapped multiple times (to different tables, potentially), and allows

entity mappings that are represented by Maps or XML at the java level. In these cases, you should

provide an explicit arbitrary name for the entity.

column

false

Any value

 

no

 

Specifies database column. If not specified hibernate will guess based on property name

foreign-key

false

Any value

 

no

 

Declaration of column name for foreign key constraint

fetch

false

join, select, subselect

 

no

 

Chooses between outer-join fetching or sequential select fetching.

properties-name

false

Any value

 

no

 

Define what <properties> tag this property belongs to.

If attribute is absent it means that property does not belong to any propertis set.

index

false

Any value

 

no

 

Name of database index

property-ref

false

Any value

 

no

 

Specifies that the foreign key refers to columns that are not the primary key of the orginal table.

node

false

Any value

 

no

 

Node definition.

not-null

false

true, false

 

no

 

Nullability status

cascade

false

Any value

 

no

 

Specifies which operations should be cascaded from the parent object to the associated object

access

false

Any value

 

no

 

The strategy Hibernate should use for accessing the property value.

optimistic-lock

false

true, false

 

no

 

Collection: species that changes to the state of the collection results in increment of the owning entity's

version.(For one to many associations, it is often reasonable to disable this setting.)

embed-xml

false

true, false

 

no

 

If embed-xml="true", the default, the XML tree for the associated entity (or collection of value type)

will be embedded directly in the XML tree for the entity that owns the association. Otherwise, if

embed-xml="false", then only the referenced identifier value will appear in the XML for single point

associations and collections will simply not appear at all.

@hibernate.map-key-many-to-many

Many to many association mapped to the key of a map ie. a map keyed on entities.

<map-key-many-to-many> is preferred to <key-many-to-many>

Unique

false

Allowed locations

class

method

constructor

field

false

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

foreign-key

false

Any value

 

no

 

Declaration of column name for foreign key constraint

formula

false

Any value

 

no

 

An arbitrary SQL expression that is executed when a type has to be evaluated. Allows content-based

discrimination.

class

false

Any value

 

no

 

Specifies the class name.

entity-name

false

Any value

 

no

 

Hibernate3 allows a class to be mapped multiple times (to different tables, potentially), and allows

entity mappings that are represented by Maps or XML at the java level. In these cases, you should

provide an explicit arbitrary name for the entity.

column

false

Any value

 

no

 

Specifies database column. If not specified hibernate will guess based on property name

@hibernate.map-key

The index of a Map may be of any basic type, mapped with <map-key>.

Unique

false

Allowed locations

class

method

constructor

field

false

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

type

true

Any value

 

no

 

Specify hibernate type.

formula

false

Any value

 

no

 

An arbitrary SQL expression that is executed when a type has to be evaluated. Allows content-based

discrimination.

node

false

Any value

 

no

 

Node definition.

length

false

Any value

 

no

 

Column length

column

false

Any value

 

no

 

Specifies database column. If not specified hibernate will guess based on property name

@hibernate.map

Defines a map

Unique

true

Allowed locations

class

method

constructor

field

false

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

lazy

false

true, false, proxy, no-proxy, extra

 

no

 

Lazyness. Lazy fetching may be completely disabled by setting lazy="false"

order-by

false

Any value

 

no

 

Specify hibernate ordering. Optional, JDK1.4 only. Specify a table column (or columns) that define the

iteration order of the Map, Set or bag, together with an optional asc or desc.

sort

false

Any value

 

no

 

Specify a sorted collection with natural sort order or a given comparator class

inverse

false

true, false

 

no

 

if this collection is inverse. Inverse mean that changes on this side of

association will not trigger database operations. in case fo bidirectional

many-to-many association one of the sides shall be declared as inverse to

prtevent strange databse behaviour. ( double inserts )

check

false

Any value

 

no

 

A SQL expression used to generate a multi-row check constraint for automatic schema generation.

subselect

false

Any value

 

no

 

aps an immutable and read-only entity to a database subselect. Useful if you want to have a view

instead of a base table, but don't.

outer-join

false

true, false, auto

 

no

 

Enable outer-join fetching

schema

false

Any value

 

no

 

Defines database schema

table

false

Any value

 

no

 

Defines database table

where

false

Any value

 

no

 

defines where clause to be used.

fetch

false

join, select, subselect

 

no

 

Chooses between outer-join fetching or sequential select fetching.

node

false

Any value

 

no

 

Node definition.

mutable

false

true, false

 

no

 

 

batch-size

false

Any value

 

no

 

Specifies batch size

access

false

Any value

 

no

 

The strategy Hibernate should use for accessing the property value.

cascade

false

Any value

 

no

 

Specifies which operations should be cascaded from the parent object to the associated object

catalog

false

Any value

 

no

 

The name of a database catalog.

collection-type

false

Any value

 

no

 

Collection type.

optimistic-lock

false

true, false

 

no

 

Collection: species that changes to the state of the collection results in increment of the owning entity's

version.(For one to many associations, it is often reasonable to disable this setting.)

embed-xml

false

true, false

 

no

 

If embed-xml="true", the default, the XML tree for the associated entity (or collection of value type)

will be embedded directly in the XML tree for the entity that owns the association. Otherwise, if

embed-xml="false", then only the referenced identifier value will appear in the XML for single point

associations and collections will simply not appear at all.

persister

false

Any value

 

no

 

Specifies a custom ClassPersister.

@hibernate.mapping

This element has several optional attributes. The <code>schema</code> and <code>catalog</code> 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 <code>default-cascade</code> attribute specifies what cascade style should be assumed

for properties and collections which do not specify a cascade attribute. The <code>auto-import</code>

attribute lets us use unqualified class names in the query language, by default.

Unique

true

Allowed locations

class

method

constructor

field

true

false

false

false

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

auto-import

false

true, false

 

no

 

Specifies whether we can use unqualified class names (of classes in this mapping) in the query language.

default-access

false

Any value

 

no

 

The strategy Hibernate should use for accessing all properties. Can be a custom implementation

of <code>PropertyAccessor</code>.

default-cascade

false

Any value

 

no

 

A default cascade style.

default-lazy

false

true, false

 

no

 

The default value for unspecifed lazy attributes of class and collection mappings.

package

false

Any value

 

no

 

Specifies a package prefix to assume for unqualified class names in the mapping document.

schema

false

Any value

 

no

 

Defines database schema

catalog

false

Any value

 

no

 

The name of a database catalog.

@hibernate.meta

Defines meta attributes.

Unique

false

Allowed locations

class

method

constructor

field

true

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

attribute

true

Any value

 

no

 

attribute name

inherit

false

true, false

 

no

 

inheritance of attribute

value

false

Any value

 

no

 

value of attribute

@hibernate.meta-value

declare meta-value element for any mappping

Unique

false

Allowed locations

class

method

constructor

field

true

true

true

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

class

true

Any value

 

no

 

specify class name

value

true

Any value

 

no

 

specify value for class

@hibernate.natural-id

declares natural id of persistent entity. individual members will be selected by

means of properties name.

Unique

true

Allowed locations

class

method

constructor

field

true

false

false

false

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

name

false

Any value

 

no

 

defines properties name to be used as selector for members of natural id

mutable

false

true, false

 

no

 

 

@hibernate.one-to-many

Declares a one-to-many association

Unique

false

Allowed locations

class

method

constructor

field

false

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

class

false

Any value

 

no

 

class of many side. either this or entity-name is required

node

false

Any value

 

no

 

Node definition.

not-found

false

exception, ignore

 

no

 

Specifies the not-found attribute.

entity-name

false

Any value

 

no

 

Hibernate3 allows a class to be mapped multiple times (to different tables, potentially), and allows

entity mappings that are represented by Maps or XML at the java level. In these cases, you should

provide an explicit arbitrary name for the entity.

embed-xml

false

true, false

 

no

 

If embed-xml="true", the default, the XML tree for the associated entity (or collection of value type)

will be embedded directly in the XML tree for the entity that owns the association. Otherwise, if

embed-xml="false", then only the referenced identifier value will appear in the XML for single point

associations and collections will simply not appear at all.

@hibernate.one-to-one

Declares a one-to-one association

Unique

false

Allowed locations

class

method

constructor

field

false

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

constrained

false

true, false

 

no

 

Is there a foreign key constraint

lazy

false

true, false, proxy, no-proxy, extra

 

no

 

Lazyness. Lazy fetching may be completely disabled by setting lazy="false"

formula

false

Any value

 

no

 

An arbitrary SQL expression that is executed when a type has to be evaluated. Allows content-based

discrimination.

outer-join

false

true, false, auto

 

no

 

Enable outer-join fetching

class

false

Any value

 

no

 

Specifies the class name.

entity-name

false

Any value

 

no

 

Hibernate3 allows a class to be mapped multiple times (to different tables, potentially), and allows

entity mappings that are represented by Maps or XML at the java level. In these cases, you should

provide an explicit arbitrary name for the entity.

foreign-key

false

Any value

 

no

 

Declaration of column name for foreign key constraint

fetch

false

join, select, subselect

 

no

 

Chooses between outer-join fetching or sequential select fetching.

property-ref

false

Any value

 

no

 

Specifies that the foreign key refers to columns that are not the primary key of the orginal table.

node

false

Any value

 

no

 

Node definition.

cascade

false

Any value

 

no

 

Specifies which operations should be cascaded from the parent object to the associated object

access

false

Any value

 

no

 

The strategy Hibernate should use for accessing the property value.

embed-xml

false

true, false

 

no

 

If embed-xml="true", the default, the XML tree for the associated entity (or collection of value type)

will be embedded directly in the XML tree for the entity that owns the association. Otherwise, if

embed-xml="false", then only the referenced identifier value will appear in the XML for single point

associations and collections will simply not appear at all.

@hibernate.parent

The parent element maps a property of the component class as a pointer back to

the owning entity

Unique

true

Allowed locations

class

method

constructor

field

false

true

false

true

@hibernate.primitive-array

Defines a primitive-array

Unique

false

Allowed locations

class

method

constructor

field

false

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

check

false

Any value

 

no

 

A SQL expression used to generate a multi-row check constraint for automatic schema generation.

subselect

false

Any value

 

no

 

aps an immutable and read-only entity to a database subselect. Useful if you want to have a view

instead of a base table, but don't.

outer-join

false

true, false, auto

 

no

 

Enable outer-join fetching

schema

false

Any value

 

no

 

Defines database schema

table

false

Any value

 

no

 

Defines database table

where

false

Any value

 

no

 

defines where clause to be used.

fetch

false

join, select, subselect

 

no

 

Chooses between outer-join fetching or sequential select fetching.

node

false

Any value

 

no

 

Node definition.

mutable

false

true, false

 

no

 

 

batch-size

false

Any value

 

no

 

Specifies batch size

access

false

Any value

 

no

 

The strategy Hibernate should use for accessing the property value.

cascade

false

Any value

 

no

 

Specifies which operations should be cascaded from the parent object to the associated object

catalog

false

Any value

 

no

 

The name of a database catalog.

collection-type

false

Any value

 

no

 

Collection type.

optimistic-lock

false

true, false

 

no

 

Collection: species that changes to the state of the collection results in increment of the owning entity's

version.(For one to many associations, it is often reasonable to disable this setting.)

embed-xml

false

true, false

 

no

 

If embed-xml="true", the default, the XML tree for the associated entity (or collection of value type)

will be embedded directly in the XML tree for the entity that owns the association. Otherwise, if

embed-xml="false", then only the referenced identifier value will appear in the XML for single point

associations and collections will simply not appear at all.

persister

false

Any value

 

no

 

Specifies a custom ClassPersister.

@hibernate.properties

Define <properties> element that allows the definition of a named, logical grouping of properties of a class.

The most important use of the construct is that it allows a combination of properties to be the target of a property-ref.

It is also a convenient way to define a multi-column unique constraint.

Unique

false

Allowed locations

class

method

constructor

field

true

false

false

false

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

name

true

Any value

 

no

 

Name of the properties

insert

false

true, false

 

no

 

Should the column appear in the SQL INSERT

unique

false

true, false

 

no

 

defines inqueness status in database terms

node

false

Any value

 

no

 

Node definition.

update

false

true, false

 

no

 

Should the column appear in the SQL UPDATE

optimistic-lock

false

true, false

 

no

 

Collection: species that changes to the state of the collection results in increment of the owning entity's

version.(For one to many associations, it is often reasonable to disable this setting.)

@hibernate.property

Defines persisten hibernate property

Unique

true

Allowed locations

class

method

constructor

field

false

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

optimistic-lock

false

true, false

 

no

 

Specifies that updates to this property do or do not require acquisition of the optimistic lock.

In other words, determines if a version increment should occur when this property is dirty.

lazy

false

true, false, proxy, no-proxy, extra

 

no

 

Lazyness. Lazy fetching may be completely disabled by setting lazy="false"

insert

false

true, false

 

no

 

Should the column appear in the SQL INSERT

formula

false

Any value

 

no

 

An arbitrary SQL expression that is executed when a type has to be evaluated. Allows content-based

discrimination.

unique

false

true, false

 

no

 

defines inqueness status in database terms

join-name

false

Any value

 

no

 

Define what <join> tag this property belongs to.

If attribute is absent it means that property does not belong to any <join> tag.

type

false

Any value

 

no

 

Specify hibernate type

update

false

true, false

 

no

 

Should the column appear in the SQL UPDATE

generated

false

newer, always, true, false

 

no

 

Specifies if the property, version or timestamp is generated by the database (for example through a trigger or stored procedure).

FOr sake of older hibernate versions we also provide true/false ( not sure we should but...)

column

false

Any value

 

no

 

Specifies database column. If not specified hibernate will guess based on property name

name

false

Any value

 

no

 

Specifies the name.

properties-name

false

Any value

 

no

 

Define what <properties> tag this property belongs to.

If attribute is absent it means that property does not belong to any propertis set.

index

false

Any value

 

no

 

Name of database index

not-null

false

true, false

 

no

 

Nullability status

node

false

Any value

 

no

 

Node definition.

length

false

Any value

 

no

 

Column length

precision

false

Any value

 

no

 

Precission.

access

false

Any value

 

no

 

The strategy Hibernate should use for accessing the property value.

scale

false

Any value

 

no

 

Scale.

@hibernate.query-list

A mapped query-list allows a named query to be attached to a property of the domain model.

Unique

false

Allowed locations

class

method

constructor

field

true

false

false

false

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

name

true

Any value

 

no

 

Name.

query-ref

true

Any value

 

no

 

Query reference definition.

@hibernate.query

Declare a named query for class. Queries are taken from defining class only.

no inheritance here due to uniqueness of names

Unique

false

Allowed locations

class

method

constructor

field

true

false

false

false

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

cache-region

false

Any value

 

no

 

Query Attribute

cacheable

false

true, false

 

no

 

Query Attribute

name

true

Any value

 

no

 

Name of this query

query

false

Any value

 

no

 

Query contents

representation

false

dom4j, dynamic-map, pojo

 

no

 

Query Parameter Representation.

@hibernate.set

Defines hibernate set mapping.

Unique

true

Allowed locations

class

method

constructor

field

false

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

lazy

false

true, false, proxy, no-proxy, extra

 

no

 

Lazyness. Lazy fetching may be completely disabled by setting lazy="false"

order-by

false

Any value

 

no

 

Specify hibernate ordering. Optional, JDK1.4 only. Specify a table column (or columns) that define the

iteration order of the Map, Set or bag, together with an optional asc or desc.

sort

false

Any value

 

no

 

Specify a sorted collection with natural sort order or a given comparator class

inverse

false

true, false

 

no

 

if this collection is inverse. Inverse mean that changes on this side of

association will not trigger database operations. in case fo bidirectional

many-to-many association one of the sides shall be declared as inverse to

prtevent strange databse behaviour. ( double inserts )

check

false

Any value

 

no

 

A SQL expression used to generate a multi-row check constraint for automatic schema generation.

subselect

false

Any value

 

no

 

aps an immutable and read-only entity to a database subselect. Useful if you want to have a view

instead of a base table, but don't.

outer-join

false

true, false, auto

 

no

 

Enable outer-join fetching

schema

false

Any value

 

no

 

Defines database schema

table

false

Any value

 

no

 

Defines database table

where

false

Any value

 

no

 

defines where clause to be used.

fetch

false

join, select, subselect

 

no

 

Chooses between outer-join fetching or sequential select fetching.

node

false

Any value

 

no

 

Node definition.

mutable

false

true, false

 

no

 

 

batch-size

false

Any value

 

no

 

Specifies batch size

access

false

Any value

 

no

 

The strategy Hibernate should use for accessing the property value.

cascade

false

Any value

 

no

 

Specifies which operations should be cascaded from the parent object to the associated object

catalog

false

Any value

 

no

 

The name of a database catalog.

collection-type

false

Any value

 

no

 

Collection type.

optimistic-lock

false

true, false

 

no

 

Collection: species that changes to the state of the collection results in increment of the owning entity's

version.(For one to many associations, it is often reasonable to disable this setting.)

embed-xml

false

true, false

 

no

 

If embed-xml="true", the default, the XML tree for the associated entity (or collection of value type)

will be embedded directly in the XML tree for the entity that owns the association. Otherwise, if

embed-xml="false", then only the referenced identifier value will appear in the XML for single point

associations and collections will simply not appear at all.

persister

false

Any value

 

no

 

Specifies a custom ClassPersister.

@hibernate.sql-delete-all

Custom sql delete all operation.

Unique

false

Allowed locations

class

method

constructor

field

true

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

value

false

Any value

 

no

 

Value of attribute

callable

false

true, false

 

no

 

Stored procedures are supported if the callable attribute is set.

@hibernate.sql-delete

Custom sql delete operation.

Unique

false

Allowed locations

class

method

constructor

field

true

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

value

false

Any value

 

no

 

Value of attribute

callable

false

true, false

 

no

 

Stored procedures are supported if the callable attribute is set.

@hibernate.sql-insert

Custom sql insert operation.

Unique

false

Allowed locations

class

method

constructor

field

true

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

value

false

Any value

 

no

 

Value of attribute

callable

false

true, false

 

no

 

Stored procedures are supported if the callable attribute is set.

@hibernate.sql-query

Declare a sql query for class. Queries are taken from defining class only.

no inheritance here due to uniqueness of names

Unique

false

Allowed locations

class

method

constructor

field

true

false

false

false

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

cache-region

false

Any value

 

no

 

Query Attribute

cacheable

false

true, false

 

no

 

Query Attribute

name

true

Any value

 

no

 

Name of this query

query

false

Any value

 

no

 

Query contents

return-scalar-column

false

Any value

 

no

 

Query Parameter Return-Scalar-Column

return-scalar-type

false

Any value

 

no

 

Query Parameter Return-Scalar-Type

callable

false

true, false

 

no

 

callability

@hibernate.sql-update

Custom sql update operation.

Unique

false

Allowed locations

class

method

constructor

field

true

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

value

false

Any value

 

no

 

Value of attribute

callable

false

true, false

 

no

 

Stored procedures are supported if the callable attribute is set.

@hibernate.subclass

Declare the current class as subclass

Unique

false

Allowed locations

class

method

constructor

field

true

false

false

false

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

lazy

false

true, false, proxy, no-proxy, extra

 

no

 

Lazyness. Lazy fetching may be completely disabled by setting lazy="false"

select-before-update

false

true, false

 

no

 

Specifies that Hibernate should never perform an SQL UPDATE unless it is certain that an object

is actually modified. In certain cases (actually, only when a transient object has been associated

with a new session using update()), this means that Hibernate will perform an extra SQL SELECT to

determine if an UPDATE is actually required.

dynamic-update

false

true, false

 

no

 

Whether dynymic update is allowed

entity-name

false

Any value

 

no

 

Hibernate3 allows a class to be mapped multiple times (to different tables, potentially), and allows

entity mappings that are represented by Maps or XML at the java level. In these cases, you should

provide an explicit arbitrary name for the entity.

dynamic-insert

false

true, false

 

no

 

Whether dynamic insert is allowed

name

false

Any value

 

no

 

Specifies the name.

proxy

false

Any value

 

no

 

Specifies an interface to use for CGLIB proxies

node

false

Any value

 

no

 

Node definition.

batch-size

false

Any value

 

no

 

Specifies batch size

abstract

false

true, false

 

no

 

Used to mark abstract superclasses in <union-subclass> hierarchies.

persister

false

Any value

 

no

 

Specifies a custom ClassPersister.

discriminator-value

false

Any value

 

no

 

Specifies discriminator value. A value that distiguishes individual subclasses, used for

polymorphic behaviour. Acceptable values include null and not null.

@hibernate.subselect

The <subselect> is available as both as an attribute and a nested mapping element.

Unique

false

Allowed locations

class

method

constructor

field

true

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

value

false

Any value

 

no

 

Value of attribute

@hibernate.synchronize

Define synchronize property.

Unique

false

Allowed locations

class

method

constructor

field

true

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

table

false

Any value

 

no

 

Defines database table

@hibernate.timestamp

Declares a timestamp property. The optional <timestamp> element indicates that the table contains

timestamped data. This is intended as an alternative to versioning. Timestamps are by nature a less safe

implementation of optimistic locking. However, sometimes the application might use the timestamps in other ways.

Unique

true

Allowed locations

class

method

constructor

field

false

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

unsaved-value

false

null, undefined

 

no

 

A version property value that indicates that an instance is newly instantiated (unsaved), distinguishing

it from detached instances that were saved or loaded in a previous session. (undefined specifies that the

identifier property value should be used.)

source

false

vm, db

 

no

 

defines source of timestamped data - whether this is generated in database

or in jvm.

node

false

Any value

 

no

 

Node definition.

access

false

Any value

 

no

 

The strategy Hibernate should use for accessing the property value.

generated

false

newer, always, true, false

 

no

 

Specifies if the property, version or timestamp is generated by the database (for example through a trigger or stored procedure).

FOr sake of older hibernate versions we also provide true/false ( not sure we should but...)

column

false

Any value

 

no

 

Specifies database column. If not specified hibernate will guess based on property name

@hibernate.tuplizer

declares tuplizer for this class

Unique

false

Allowed locations

class

method

constructor

field

true

false

false

false

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

entity-mode

false

pojo, dom4j, dynamic-map

 

no

 

applicable entity mode

class

true

Any value

 

no

 

defines tupliter class name

@hibernate.type-param

Parameter for type definition.

Unique

false

Allowed locations

class

method

constructor

field

false

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

name

true

Any value

 

no

 

Parameter name.

value

false

Any value

 

no

 

Parameter value.

@hibernate.type

You may even supply parameters to a UserType in the mapping file. To do this, your UserType must implement

the org.hibernate.usertype.ParameterizedType interface. To supply parameters to your custom type, you

can use the <type> element in your mapping files.

Unique

false

Allowed locations

class

method

constructor

field

false

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

name

true

Any value

 

no

 

Name of a UserType class

@hibernate.typedef-param

Parameter for typedef definition.

Unique

false

Allowed locations

class

method

constructor

field

true

false

false

false

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

typedef-name

false

Any value

 

no

 

Name of typedef

name

true

Any value

 

no

 

Parameter name.

value

false

Any value

 

no

 

Parameter value.

@hibernate.typedef

If you use a certain UserType very often, it may be useful to define a shorter name for it. You can do this using

the <typedef> element. Typedefs assign a name to a custom type, and may also contain a list of default

parameter values if the type is parameterized.

Unique

false

Allowed locations

class

method

constructor

field

true

false

false

false

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

class

true

Any value

 

no

 

User type class name.

name

true

Any value

 

no

 

Type name.

@hibernate.union-subclass

Declare the current class as union subclass

Unique

false

Allowed locations

class

method

constructor

field

true

false

false

false

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

check

false

Any value

 

no

 

A SQL expression used to generate a multi-row check constraint for automatic schema generation.

lazy

false

true, false, proxy, no-proxy, extra

 

no

 

Lazyness. Lazy fetching may be completely disabled by setting lazy="false"

select-before-update

false

true, false

 

no

 

Specifies that Hibernate should never perform an SQL UPDATE unless it is certain that an object

is actually modified. In certain cases (actually, only when a transient object has been associated

with a new session using update()), this means that Hibernate will perform an extra SQL SELECT to

determine if an UPDATE is actually required.

dynamic-update

false

true, false

 

no

 

Whether dynymic update is allowed

entity-name

false

Any value

 

no

 

Hibernate3 allows a class to be mapped multiple times (to different tables, potentially), and allows

entity mappings that are represented by Maps or XML at the java level. In these cases, you should

provide an explicit arbitrary name for the entity.

dynamic-insert

false

true, false

 

no

 

Whether dynamic insert is allowed

name

false

Any value

 

no

 

Specifies the name.

proxy

false

Any value

 

no

 

Specifies an interface to use for CGLIB proxies

node

false

Any value

 

no

 

Node definition.

batch-size

false

Any value

 

no

 

Specifies batch size

abstract

false

true, false

 

no

 

Used to mark abstract superclasses in <union-subclass> hierarchies.

persister

false

Any value

 

no

 

Specifies a custom ClassPersister.

subselect

false

Any value

 

no

 

aps an immutable and read-only entity to a database subselect. Useful if you want to have a view

instead of a base table, but don't.

schema

false

Any value

 

no

 

Defines database schema

catalog

false

Any value

 

no

 

The name of a database catalog.

table

false

Any value

 

no

 

Defines database table

@hibernate.version

Declares a version property. The <version> element is optional and indicates that the table contains

versioned data. This is particularly useful if you plan to use long transactions

Unique

false

Allowed locations

class

method

constructor

field

false

true

false

true

Parameter

Required

Allowed values

Default value

Array

Token separator

Description

unsaved-value

false

null, negative, undefined

 

no

 

A version property value that indicates that an instance is newly instantiated (unsaved), distinguishing

it from detached instances that were saved or loaded in a previous session. (undefined specifies that

the identifier property value should be used.)

generated

false

Any value

 

no

 

 

type

false

Any value

 

no

 

Specify hibernate type

access

false

Any value

 

no

 

The strategy Hibernate should use for accessing the property value.

column

false

Any value

 

no

 

Specifies database column. If not specified hibernate will guess based on property name

Powered by Atlassian Confluence