facebook

MyEclipse Hibernate Reverse Engineering

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #263458 Reply

    jkatz
    Member

    Should 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”&gt;
    <!–
    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”&gt;
    <!–
    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>

    #263466 Reply

    Haris Peco
    Member

    jkatz,

    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,

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: MyEclipse Hibernate Reverse Engineering

You must be logged in to post in the forum log in