2 Replies Latest reply on Jul 12, 2010 9:32 AM by alexg.agout.planet.nl

    Reverse engineering does not set property names

    alexg.agout.planet.nl

      Hi,


      Im trying to reverse engineer a MySQL database and it works all very fine, untill I try to set some property names in seam-reveng.xml.
      I tested also if it would create an entity with specified name, and that does work (see my test below). The fieldnames in my MySQL database are all uppercase. I tried lowercase however, just for the sake of it but that didnt work either. I also tried with and without specifying the catalog, but that also makes no difference. None of the property names get set to the value I want them to be.


      Here's my seam-reveng.xml:




      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE hibernate-reverse-engineering SYSTEM "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" >
      <hibernate-reverse-engineering>
      
      <table name="Category" class="org.alex.auctionhouse.model.Cat1"><!-- entity name test, works! -->
      <column name="FK_PARENT" property="parentCategory"/>
      <column name="FK_PARENT" property="rootCategory"/>
      </table>
      
      <table name="Auction">
      <column name="FK_WINNERBID" property="winnerBid"/>
      <column name="FK_ACCOUNT" property="owner"/>
      <column name="BUYOUT" property="buyout"/>
      </table>
      
      <table name="Bid">
      <column name="IS_BUYOUTBID" property="buyoutBid"/>
      </table>
      </hibernate-reverse-engineering>





      here's my build.properties:




      #Generated by seam setup
      #Mon Jul 05 21:59:02 CEST 2010
      hibernate.connection.password=*********
      workspace.home=/Users/alexgout/Development/seamProjects
      hibernate.connection.dataSource_class=com.mysql.jdbc.jdbc2.optional.MysqlDataSource
      model.package=org.alex.auctionhouse.model
      driver.jar=/usr/local/mysql/lib/mysql-jdbc-5.1.13.jar
      action.package=org.alex.auctionhouse.action
      test.package=org.alex.auctionhouse.test
      database.type=mysql
      richfaces.skin=deepMarine
      glassfish.domain=domain1
      hibernate.default_catalog=auctionhouse
      hibernate.default_schema.null=
      database.drop=n
      project.name=auctionhouse
      hibernate.connection.username=auctionhouse
      glassfish.home=
      hibernate.connection.driver_class=com.mysql.jdbc.Driver
      hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider
      jboss.domain=default
      project.type=ear
      icefaces.home=
      database.exists=y
      jboss.home=/Users/alexgout/Development/jboss-5.0.0.GA
      driver.license.jar=
      hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
      hibernate.connection.url=jdbc\:mysql\://localhost\:3306/AuctionHouse
      icefaces=n
      hibernate.hbm2ddl.auto=validate






      I'm using Seam 2.2.0GA.


      I searched on this forum, and found several other topics on this matter. However, none of the solutions presented fix my problem. Im new to Seam and Hibernate, so I hope someone can help me with this.


      Thanks

        • 1. Re: Reverse engineering does not set property names
          alexg.agout.planet.nl
          Sorry, there's two FK_PARENT's in the seam-reveng.xml above. It should be:

          <?xml version="1.0" encoding="UTF-8"?>
          <!DOCTYPE hibernate-reverse-engineering SYSTEM "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" >
          <hibernate-reverse-engineering>

          <table name="Category" class="org.alex.auctionhouse.model.Cat1"><!-- entity name test, works! -->
          <column name="FK_PARENT" property="parentCategory"/>
          <column name="FK_PARENT" property="rootCategory"/>
          </table>

          <table name="Auction">
          <column name="FK_WINNERBID" property="winnerBid"/>
          <column name="FK_ACCOUNT" property="owner"/>
          <column name="BUYOUT" property="buyout"/>
          </table>

          <table name="Bid">
          <column name="IS_BUYOUTBID" property="buyoutBid"/>
          </table>
          </hibernate-reverse-engineering>

          the problem remains the same.
          • 2. Re: Reverse engineering does not set property names
            alexg.agout.planet.nl

            I'm so sorry :( one FKPARENT should be FKROOT.