|
|
HibernateTags
Defines a column for the any type mapping
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. |
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
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. |
defines array collection. @hibernate.key , @hibernate.index and collection element shall be specified
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. |
Defines a collection with a bag semantic. It's like list, but does not need explicit
indexing column. This tag requires bag element definition.
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. |
Enables caching
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 |
Declare a persistent class
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. |
<collection-id> definition for <idbag>.
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 |
Customize column mapping.
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. |
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
class |
method |
constructor |
field |
true |
true |
true |
true |
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.
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. |
Declares a composite collection element
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. |
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.
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. |
Composite index of a map ie. a map keyed on components.
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. |
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.
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 |
Composite index of a map ie. a map keyed on components.
<composite-map-key> is preferred to <composite-index>
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. |
Declares column as child of key element
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. |
Defines a discriminator. Polymorphic data requires a column holding a class discriminator value. This
value is not directly exposed to the application.
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 |
Declares the element type of a collection of basic ( primitive ) type.
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 |
Top-level filter definition.
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. |
Filter parameter definition.
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 |
Definition of a filter attached to a class or collection.
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. |
Formula an arbitrary SQL expression that is executed when a type has to be evaluated.
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 |
If any parameters are required to configure or initialize the generator instance, they are
passed using the <param> element.
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. |
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.
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 |
Defines a idbag.
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. |
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.
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. |
declares column as child of index element
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. |
Many to many association mapped to the key of a map ie. a map keyed on entities.
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. |
Declares many-to-many collection index. Will be used as map key for ternary associations. Shall be an entity
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 |
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.
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 |
Enables caching
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 |
Using the <join-key> element, it is possible to map properties of one class to several tables.
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. |
Using the <join> element, it is possible to map properties of one class to several tables.
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. |
Declares a joined-subclass key
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 |
Declare the current class as joined subclass
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 |
Declares column as child of key element
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. |
Define many-to-one key property
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 |
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 |
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.
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 |
Declare of a list-index tag for array or list. <list-index> is preferred to <index>.
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 |
Defines a List
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. |
Defines loader.
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. |
Declares many-to-any type mapping
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. |
Many to many association. This tag declares the entity-class
element type of a collection and specifies a many-to-many relational model
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. |
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.
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. |
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>
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 |
The index of a Map may be of any basic type, mapped with <map-key>.
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 |
Defines a map
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. |
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.
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. |
Defines meta attributes.
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 |
declare meta-value element for any mappping
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 |
declares natural id of persistent entity. individual members will be selected by
means of properties name.
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 |
|
|
Declares a one-to-many association
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. |
Declares a one-to-one association
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. |
The parent element maps a property of the component class as a pointer back to
the owning entity
class |
method |
constructor |
field |
false |
true |
false |
true |
Defines a primitive-array
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. |
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.
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.) |
Defines persisten hibernate property
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. |
A mapped query-list allows a named query to be attached to a property of the domain model.
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. |
Declare a named query for class. Queries are taken from defining class only.
no inheritance here due to uniqueness of names
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. |
Defines hibernate set mapping.
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. |
Custom sql delete all operation.
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. |
Custom sql delete operation.
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. |
Custom sql insert operation.
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. |
Declare a sql query for class. Queries are taken from defining class only.
no inheritance here due to uniqueness of names
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 |
Custom sql update operation.
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. |
Declare the current class as subclass
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. |
The <subselect> is available as both as an attribute and a nested mapping element.
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 |
Define synchronize property.
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 |
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.
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 |
declares tuplizer for this class
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 |
Parameter for type definition.
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. |
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.
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 |
Parameter for typedef definition.
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. |
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.
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. |
Declare the current class as union subclass
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 |
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
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 |
|