facebook

Oracle Hibernate reverse engineering – Integer to BigDeciml

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

    dcurrit
    Member

    My primary key in the Oracle table is of type Integer. When I do the reverse engineering, it converts integer to BigDecimal. The primary key is generated by an Oracle Sequence that returns a “Long” so it gives me an error. How can I get it to convert Integer to Long?

    I have tried adding the following

    <hibernate-reverse-engineering>
    <type-mapping>
    <sql-type jdbc-type=”DECIMAL” hibernate-type=”java.lang.Long”></sql-type>
    <sql-type jdbc-type=”INTEGER” hibernate-type=”java.lang.Long”></sql-type>
    </type-mapping>
    </hibernate-reverse-engineering>

    to the hibernate.reveng.xml file.

    #292436 Reply

    Loyal Water
    Member

    You can custom map the integer to long on the 2nd page of the Hibernate Reverse engineering wizard. In the customized type mapping table, map the hibernate type to the JDBC type you want.

    #292556 Reply

    dcurrit
    Member

    This message has not been recovered.

    #292633 Reply

    Loyal Water
    Member

    This message has not been recovered.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Oracle Hibernate reverse engineering – Integer to BigDeciml

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