- This topic has 1 reply, 2 voices, and was last updated 17 years, 10 months ago by Haris Peco.
-
AuthorPosts
-
jkatzMemberShould I have to manually modify the *.hbm.xml file after I complete the reverse engineering mapping generation when I request a sequence to be generated for the ID? I am generating mappings for an Oracle (9i) database.
The file looks like the following before editing:
<?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”>
<!–
Mapping file autogenerated by MyEclipse – Hibernate Tools
–>
<hibernate-mapping>
<class name=”com.genericscheduler.hibernate.Processes” table=”PROCESSES” schema=”SCOTT”>
<id name=”processId” type=”java.lang.Long”>
<column name=”PROCESS_ID” precision=”5″ scale=”0″ />
<generator class=”sequence” />
</id>
<property name=”process” type=”java.lang.String”>
<column name=”PROCESS” length=”124″ />
</property>
<property name=”UPDATED_ON” type=”timestamp”>
<column name=”UPDATED_ON” />
</property>
</class>
</hibernate-mapping>and after editing:
<?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”>
<!–
Mapping file autogenerated by MyEclipse – Hibernate Tools
–>
<hibernate-mapping>
<class name=”com.genericscheduler.hibernate.Processes” table=”PROCESSES” schema=”SCOTT”>
<id name=”processId” type=”java.lang.Long”>
<column name=”PROCESS_ID” precision=”5″ scale=”0″ />
<generator class=”sequence”>
<param name=”sequence”>auto_seq</param>
</generator>
</id>
<property name=”process” type=”java.lang.String”>
<column name=”PROCESS” length=”124″ />
</property>
<property name=”UPDATED_ON” type=”timestamp”>
<column name=”UPDATED_ON” />
</property>
</class>
</hibernate-mapping>
Haris PecoMemberjkatz,
You are correct.We will add better sequence generator in future release.You have to add param for now.
Sorry for the inconvenience caused.
Regards,
-
AuthorPosts