Element attributes of the hibernate ing File

Source: Internet
Author: User

Reprinted

Doctype
<? XML version = "1.0" encoding = "UTF-8"?>
<! Doctype hibernate-mapping public "-// hibernate/hibernate mapping DTD 3.0 // en" "Http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<! -- Generated 2008-10-1 20:56:03 by hibernate tools 3.2.1.ga -->

Root element hibernate-Mapping

Attribute:

Schema: Database schema name

Catalog: Database catalog name

Default-cascade: the default cascade method is none.

Default-Access: Default attribute access method default value: Property

Default-Lazy: Set the default value of delayed loading to true for the ing classes and collections that do not specify delayed loading.

Auto-import: sets whether incomplete class names (excluding Package Names) can be used in hql. The default value is true.

Package: Default package name of the class in the ing File

Child element:

Meta: used to set the metadata attributes of a class or attribute.

Typedef: defines the new hibernate Data Type

Import: displays a reference class to avoid using the full class name in hql statements.

Class: defines a persistent class.

Subclass: defines the child class of the parent class for multi-state persistence.

Joined-subclass: defines a connection subclass.

Union-subclass: defines a union subclass.

Query: defines an hql query.

SQL-query: defines an SQL query.

Filter-Def: defines the filter.

Class Element

Attribute:

Name: full name of the persistence class

Table: the default value of the corresponding database table name is the class name.

Discriminator-value: identifies a subclass. The default value is the class name.

Mutable: indicates whether the instance of this class is variable. The default value is false.

Schema: database schema name

Catalog: Database catalog name

Proxy: Specify the delayed loading proxy class.

Dynamic-Update: Specifies whether the SQL statement used for update is dynamically generated. The default value is false.

Dynamic-insert: Specifies whether the SQL statement used for insert is dynamically generated. The default value is false.

Insert-before-Update: sets whether to use the SELECT statement to determine whether the object has been modified before hibernate executes update. If the object value has not changed, the update statement will not be executed. The default value is false.

Polymorphism: specifies that the default value of multi-state query is implicit.

Where: Specifies the where condition for an additional SQL statement.

Persister: specify a persister class

Batch-size: set the number of batch operation records. The default value is 1.

Optimistic-lock: Specifies the Optimistic Locking policy. The default value is vesion.

Lazy: whether to use delayed Loading

Entity-name: the default object name is the class name.

Check: Specifies an SQL statement for condition check before schema.

Rowid: Specifies whether rowid is supported

Subselect: maps immutable read-only entities to subqueries in the database.

Abstract: The default value of the super class used to identify abstraction in the Union subclass is false.

 

Child element:

Meta: sets the metadata attributes of a class or attribute.

Subselect: defines a subquery.

Cache: defines cache policies.

Synchronize: defines the synchronization resources required by the persistence class.

Comment: Comment on the definition table

ID: Id field corresponding to the primary key of the table corresponding to the database in the ing Class (the primary key of the independent field in the table)

Composite-ID: Id field corresponding to the primary key of the table corresponding to the database in the ing Class (the table is the primary key of the Union field)

Natural-ID: declares a unique business primary key.

Discriminator: defines an authenticator.

Vesion: Specifies the data with version information contained in the table.

Timestamp: specifies the time stamp data in the table.

Property: defines the attributes of a persistence class.

Allow-to-one: defines the multi-to-one relationship between objects.

One-to-one: defines the one-to-one relationship between objects.

Component: define component ing

Dynamic-component: defines dynamic component ing

Properties: defines a logical group containing multiple attributes.

Any: defines the any ing type.

Map: Map-type set ing

Set: set type set ing

List: List type set ing

Bag: Collection ing of the Bag Type

Array: array-type set ing

Primitive-array: Set ing of the primitive-array type

Query-list: ing the set returned by the query

Join: maps the attributes of a class to multiple tables.

Sub-class: Declares the subclass in the polymorphism ing.

Joined-subclass: to join subclass in the life-state ing

Union-subclass: Declares the Union subclass in the multi-state ing.

Loader: a loader that defines persistent objects.

SQL-insert: Use a custom SQL statement to execute the insert operation

SQL-Update: Use a custom SQL statement to perform the update operation.

SQL-delete: Use a custom SQL statement to perform the delete operation.

Filter: defines the filters used by hibernate.

Query: defines the hql statement for loading objects.

SQL-query: SQL statement that defines the object to be loaded

Id Element

Attribute:

Name: attribute name corresponding to the primary key in the ing Class

Type: Data Type of the primary key attribute

Column: the name of the primary key field. The default value is the attribute name.

Unsaved-value: determines whether the object is saved.

Access: the default value of the policy for accessing the primary key attribute of Hibernate is property.

Child element:

Generator: generate a unique identifier for a persistent instance

Generator element

Attribute:

Class: defines the instance generator.

Increment (Increment)UsedLong,ShortOrIntType to generate a unique identifier. Data can be used only when no other process inserts data into the same table.Do not use it in a cluster. IdentitySupports built-in identity fields for DB2, MySQL, ms SQL Server, Sybase, and hypersonicsql. The returned identifier isLong,ShortOrIntType.
Sequence (Sequence)Use sequence in DB2, PostgreSQL, Oracle, sap db, and mckoi, and generator in InterBase ). The returned identifier isLong,ShortOrIntType.
HiLo (High/low bit)Use a high/low positionAlgorithmTo generate efficientlyLong,ShortOrIntType identifier. Given a table and a field (the default isHibernate_unique_keyAndNext_hi. The identifier generated by the high/low algorithm is unique only in a specific database.Do not use this generator in the connection obtained by using JTA or the connection provided by the user.
Seqhilo (Use the high/low bits of the sequence)Use a high/low algorithm to efficiently generateLong,ShortOrIntType identifier, given the name of a database sequence (sequence.
UUID. HEXUse a 128-bit UUID algorithm to generate string-type identifiers. It is unique in a network (using an IP address ). UUID is encoded as a 32-bit hexadecimal number string.
UUID. StringUse the same UUID algorithm. UUID is encoded as a string consisting of 16 characters long and any ASCII characters.Cannot be used in a PostgreSQL database
Native (Local)Selection Based on the capabilities of the underlying databaseIdentity,SequenceOrHiLo.
Assigned (ProgramSet)Make the applicationSave ()Previously, an identifier was assigned to the object.
Foreign (External Reference)Use the identifier of another associated object. And<One-to-one>Used together.

Name: Name of the ing Class Property

Column: The default field name of the corresponding database table is the attribute name.

Type: Field Type

Update: whether the update operation contains the data of this field. The default value is true.

Insert: whether the insert operation contains the data of this field. The default value is true.

Formula: defines an SQL statement to calculate the value of this attribute.

Access: the Default policy for hibernate to access this property is property.

Lazy: Set whether to use the delayed loading policy. The default value is false.

Unique: sets whether the field value is unique. The default value is false.

Not-null: Set whether the field value can be null. The default value is false.

Optimistic-lock: Specifies whether Optimistic Locking is required when this attribute is updated. The default value is true.

SetElement

Attribute:

Name: Name of the ing Class Property

Access: the Default policy for hibernate to access this property is property.

Table: Associated target database table

Schema: schema name of the target database table

Catalog: The Catalog name of the target database table.

Lazy: whether to use delayed Loading

Subselect: defines a subquery.

Sort: Set the default value of the sorting type to unsorted. The optional value is natural sorting. comparatorclass implements the interface class as the Sorting Algorithm to avoid simultaneous use with order-.

Inverse: used to identify a passive party in a two-way Association. The default value is false.

Mutable: identifies whether the associated object can be changed. The default value is true.

Cascade: set the cascade policy value in the operation to all. cascade is performed for all operations, none is performed for all operations, cascade is performed for the save-update operation, and delete is executed for the update operation. when the delete operation is performed, cascade and all-delete-orphan are deleted when the associated object loses its host.

Order-by: Set sorting rules

Where: adds filter conditions.

Batch-size: the number of data read at one time during Delayed loading. The default value is 1.

Fetch: sets the data capture policy. Optional values: Join Outer Join capturing and select capture.

One-to-oneElement

Attribute:

Name: Name of the ing Class Property

Class: The target class of the ing.

Cascade: set the cascade policy value in the operation to all. cascade is performed for all operations, none is performed for all operations, cascade is performed for the save-update operation, and delete is executed for the update operation. cascade operations during Deletion

Constrained: Indicates whether there is a foreign key constraint between the table corresponding to the current class and the associated table. The default value isFalse

Fetch: sets the data capture policy. Optional values: Join Outer Join capturing and select capture.

Property-Ref: Set the attribute name of the associated class. This attribute corresponds to the primary key of the associated class by default.

Access: the Default policy for hibernate to access this property is property.

Formula: the vast majority of one-to-one links point to the primary key of the actual body. In some cases, it will point to one or more fields or an expression. At this time, an SQL formula can be used to represent

Lazy: specifies whether to use the delayed loading and loading policies. The default value is proxy. The value of proxy is used for association. The optional value is true. This object uses delayed loading and is crawled when the variable is accessed for the first time. False. This correlated object does not use delay. load

Entity-Name: Object Name of the associated class

Allow-to-oneElement

Attribute:

Name: Name of the ing Class Property

Column: Associated fields

Class: name of the associated class

Cascade: set the cascade policy value in the operation to all. All operations are cascade, none is cascade, and save-update is used to perform the SAVE and update operations, cascading when Delete is performed

Fetch: sets the data capture policy. The default value is select sequence. The optional value is join Outer Join capturing.

Update: whether this field is included in the update operation.

Insert: whether the insert operation contains this field

PropertyElement

Attribute:

Property-Ref: Set the attribute name of the associated class. The default value of this attribute is the primary key of the associated class.

Access: the Default policy for hibernate to access this property is property.

Unique: sets whether the field value is unique. The default value is false.

Not-null: Set whether the field value can be null. The default value is false.

Optimistic-lock: Specifies whether Optimistic Locking is required when this attribute is updated. The default value is true.

Lazy: specifies whether to use the delayed loading and loading policies. The default value is proxy. The value of proxy is used for association. The optional value is true. This object uses delayed loading and is crawled when the variable is accessed for the first time. False. This correlated object does not use delay. load

Not-found: Specifies how to associate a non-existent application with null when the data referenced by the foreign key does not exist. The default value is exception. The optional value is ignore.

Entity-Name: Object Name of the associated class

 

Allow-to-oneElement

Attribute:

Column: Link fields of the intermediate join table mapped to the target joined table

Class: The Associated target class.

Fetch: sets the data capture policy. The default value is select sequence. The optional value is join Outer Join capturing.

Lazy: specifies whether to use the delayed loading and loading policies. The default value is proxy. The value of proxy is used for association. The optional value is true. This object uses delayed loading and is crawled when the variable is accessed for the first time. False. This correlated object does not use delay. load

Formula: the vast majority of one-to-one links point to the primary key of the actual body. In some cases, it will point to one or more fields or an expression. At this time, an SQL formula can be used to represent

 

Not-found: Specifies how to associate a non-existent application with null when the data referenced by the foreign key does not exist. The default value is exception. The optional value is ignore.

Entity-Name: Object Name of the associated class

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.