Hibernate

Sequence Generator
Previous Home Next

sequence gnerator uses the sequence define in the database for generating id.Consider

Emp.xml

<?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">
<!-- r4r.co.in. -->
<hibernate-mapping>
<class name="r4r.Emp">
<id name="id" type="int">
<generator class="sequence">
<param name="sequence">oursequence</param>
</generator>
</id>
<property name="name"></property>
<property name="job"></property>
<property name="salary" type="int"></property>
</class>
</hibernate-mapping>
Previous Home Next

Tolal:0 Click:

Show All Comments

Did not find what you were looking for leave your name and message. We will revert within 24 hours
Name:
eMail:
Comment / Feedback: