1: Optimization for hibernate auto-generation, and high-low bit algorithm in OID.
<?xml version= "1.0" encoding= "UTF-8"?>
<!--DTD file on: HIBERNATE3.JAR\ORG\HIBERNATE\HIBERNATE-MAPPING-3.0.DTD-
<! DOCTYPE hibernate-mapping Public
"-//hibernate/hibernate Mapping DTD 3.0//en"
"Http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd" >
<!--dynamic-update= "true" to change the SQL statement to only the updated field. -
<class name= "Com.anrongtec.domain.Person" table= "PERSONS" ><!--mutable= all fields in the "false" class will not be updated. -
<!--map the primary key--
<!--<id name= "id" column= "id" type= "int" length= "one" >
Primary key generation strategy: For the moment, remember to use native
<generator class= "native" ></generator>
The OID allows hibernate to control.
</id>
<id name= "id" column= "id" type= "int" length= "one" >
<!--PRIMARY key generation strategy: For the moment, remember to use native--
<generator class= "Hilo" ><!--high and low bit generation strategy--
<!--designated Storage low
<param name= "Table" >tt</param>
<!--Specify a field that holds low values--
<param name= "column"->value</param>
<!--the largest low value--
<param name= "Max_lo" >5</param>
</generator>
</id>
<!--the relationship between attributes in a map class and database table fields--
<property name= "name" insert= "false" column= "name" ></property>
<property name= "Birthday" column= "Birthday" ></property>
<property name= "Address" column= "Address" ></property>
</class>
What the OID in 2:hibernate is, and how to configure it.
Hibernate's object identifier (OID)
You can use the <id> element to set the oid,oid can be defined as the Short,int,long type, and by default, hibernate will define the OID as the Java wrapper type when the persistence class is generated
Use the <generator> child element in the ID element to set the identifier generator, for example:
<id type= "Long" column= "id" >
<generator/>
</id>
The following is a built-in identifier generator provided by Hibernate:
1.increment
2.identity
3.sequence
4.hilo
5.native
6.uuid
7.assigned
The OID of Hibernate