org.hibernate.xsd.mapping.legacy-mapping-4.0.xsd Maven / Gradle / Ivy
This document defines the legacy Hibernate mapping schema. The root element in
such mappings is the hibernate-mapping element.
The document root.
Describes an XSD base type for any complex type that can contain "tooling hints".
is used to assign meta-level attributes to a class
or property. Is currently used by tooling as a placeholder for
values that is not directly related to OR mappings.
Example: the-hint-value
]]>
element defines a single path to which the fetch
refers, as well as the style of fetch to apply. The 'root' of the
path is different depending upon the context in which the
containing occurs; within a element,
the entity-name of the containing class mapping is assumed...
]]>
The sql-query element declares a named SQL query string
The query-param element is used only by tools that generate
finder methods for named queries
The resultset element declares a named resultset mapping definition for SQL queries
Defines a return component for a sql-query. Alias refers to the alias
used in the actual sql query; lock-mode specifies the locking to be applied
when the query is executed. The class, collection, and role attributes are mutually exclusive;
class refers to the class name of a "root entity" in the object result; collection refers
to a collection of a given class and is used to define custom sql to load that owned collection
and takes the form "ClassName.propertyName"; role refers to the property path for an eager fetch
and takes the form "owningAlias.propertyName"
Root entity mapping. Poorly named as entities do not have to be represented by
classes at all. Mapped entities may be represented via different methodologies
(POJO, Map, Dom4j).
vs. @name usage...
]]>
vs. @name usage...
]]>
vs. @name usage...
]]>
Declares the id type, column and generation algorithm for an entity class.
If a name attribute is given, the id is exposed to the application through the
named property of the class. If not, the id is only exposed to the application
via Session.getIdentifier()
A composite key may be modelled by a java class with a property for each
key column. The class must implement java.io.Serializable and reimplement equals()
and hashCode().
Type definition that acts as a base for concrete definitions of mapped
attributes that can function as the basis of optimistic locking.
Optimistic locking attribute based on an incrementing value.
Optimistic locking attribute based on a (last-updated) timestamp.
A natural-id element allows declaration of the unique business key
Polymorphic data requires a column holding a class discriminator value. This
value is not directly exposed to the application.
A discriminated association where the discriminator is part of the
association, not the associated entity (compared to discriminator subclass)
Defines the mapping of a discriminator value to a concrete entity in an any or
any-to-many mapping.
The column element is an alternative to column attributes and required for
mapping associations to classes with composite ids.
The comment element allows definition of a database table or column comment.
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. A null component reference
is mapped to null values in all columns and vice versa. Components do not support
shared reference semantics.
A composite element allows a collection to hold instances of an arbitrary
class, without the requirement of joining to an entity table. Composite elements
have component semantics - no shared references and ad hoc null value semantics.
Composite elements may not hold nested collections.
A dynamic-component maps columns of the database entity to a java.util.Map
at the Java level
Declares the element type of a collection where the element is of basic type
FILTER element; used to apply a filter.
Generators generate unique identifiers. The class attribute specifies a Java
class implementing an id generation algorithm.
Describes the index of an indexed collection. Indexed collection means either
a java.util.List, a persistent array or a java.util.Map.
For a List or array, this describes the list/array index value. Should prefer
to use 'list-index' instead.
For a Map, this describes the Map key value. Should prefer to use 'map-key' instead
A join allows some properties of a class to be persisted to a second table
Declares the column name of a foreign key.
A many-to-one association embedded in a composite identifier or map index
(always not-null, never cascade).
A property embedded in a composite identifier or map index (always not-null).
The loader element allows specification of a named query to be used for fetching
an entity or collection
A "many to any" defines 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).
Describes the key of a java.util.Map where the key is a basic (JPA term) type
Describes the key of a java.util.Map where the key is a composite type
Describes the key of a java.util.Map where the key is an association (FK)
Describes the key of a java.util.Map which is a composite. Should prefer
'composite-map-key' instead
Describes the key of a java.util.Map which is an FK-association. Should prefer
'map-key-many-to-many' instead
The parent element maps a property of the component class as a pointer back to
the owning entity.
properties declares that the contained properties form an alternate key. The name
attribute allows an alternate key to be used as the target of a property-ref.
TUPLIZER element; defines tuplizer to use for a component/entity for a given entity-mode
Declares the type of the containing property (overrides an eventually existing type
attribute of the property). May contain param elements to customize a ParametrizableType.
Define a class name type which can be used in the attribute value which requires a class name,
either qualified or not, time to do the validation.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy