3 Replies Latest reply on Jan 12, 2006 3:09 PM by ameelin

    Question applies to using Hibernate with JBoss IDE

    ameelin

      a) I have some tables to map and generate artifacts for...One of the table names in my schema is named "Package" which conflicts with java keyword/reserved-word "package"...aargh!
      Can I somehow change "Package" class to "Package1" or something else (other than "Package") in reveng.xml

      b) Using "reveng.xml" how do I change the datatype from Integer to a regular "int"

        • 1. Re: Question applies to using Hibernate with JBoss IDE
          maxandersen

          add a [table name="Package" class="Package1"/] in reveng.xml

          the reveng.xml editor in the just released jbosside unfortunately doesnt have the class attribute in the ui, but you can add it manually.

          the next version of hibernate tools will have the class attribute.

          • 2. Re: Question applies to using Hibernate with JBoss IDE
            maxandersen


            b)

            you need to find out what the jdbc type of the column for the property is and add something like the following to reveng.xml:

            <type-mapping>
            <sql-type jdbc-type="NUMERIC" hibernate-type="int"/>
            </type-mapping>

            that will work for all NUMERIC typed columns.

            if it is a specific column then



            is the way to go.

            note all of this is available via the reveng.xml editor.

            • 3. changing "private Package1 package;" in generated to "privat
              ameelin

               

              "max.andersen@jboss.com" wrote:
              add a [table name="Package" class="Package1"/] in reveng.xml

              the reveng.xml editor in the just released jbosside unfortunately doesnt have the class attribute in the ui, but you can add it manually.

              the next version of hibernate tools will have the class attribute.


              Max what you said worked, but ran into this in code that uses Package1...
              private Package1 package;

              and "package" is a key/reserved word in Java
              How can I tweak that?