1 Reply Latest reply on Sep 17, 2010 2:44 PM by 20div0

    seam generate-model issue

    20div0
      I have been using jbosstools with eclipse and the database reverse engineering works fine.

      Now, I created a new project using seam-gen on the same database. On a table with foreign keys referring to it, hibernate generates two fields for each foreign key.

      For example, if I have an Item table referring to the Category table, the Category model generated will have the following:

              private Set<Item> items = new HashSet<Item>(0);
              private Set<Item> items_1 = new HashSet<Item>(0);

      Again, on the same db using jbosstool do not have the same problem. Both are using Seam 2.2.0_GA.

      I can manually delete the extract field but it's annoying. Any idea?

      Andy
        • 1. Re: seam generate-model issue
          20div0

          This is the exact issue I am running into:


          http://www.seamframework.org/Documentation/WhyDoISeeDuplicateAssociationsAfterReverseEngineering


          I just got lucky and stumble on this. However, I changed my hibernate.hbm2ddl.auto property in my persistent-dev.xml in my project to none and rerun seam generate-model but it's still the same.


          Does anyone use seam-gen at all?


          The FAQ was create over 1.5 years ago and Hibernate has fixed the bug over a year ago but Seam still doesn't include the fix in there?


          I try to replace the hibernate-core.jar under /lib in seam with the newer 3.3.2 jar (that has the fix in it) but somehow seam-gen still uses 3.2.4 to generate the models. How should I replace the hibernate manually? Anyone?


          Andy