2 Replies Latest reply on Feb 17, 2008 4:09 PM by Jason G

    seam-gen problem with generate-ui and repeated types

    Jason G Newbie

      I am designing from the entities out and the seam-gen generate-ui is incredibly helpful. Great stuff.

      I've noticed a minor thing that I have questions on.

      I believe this is a bug... anyone care to confirmation and/or tell me where to log the issue to be fixed in a future release?

      The problem is best shown with a contrived example. Suppose I'm building a model of a house and the doors in the house. Here are two simple entities:

      @Entity public class House {
      @Id private Long id;
      @OneToOne private Door frontDoor;
      @OneToOne private Door backDoor;
      ...
      }

      @Entity public class Door {
      @Id private Long id;
      private String description;
      ...
      }

      When I run seam-gen's generate-ui command, I get a HouseHome.java file that has the following annotations:

      @In(create = true)
      DoorHome doorHome;
      @In(create = true)
      DoorHome doorHome;

      The obvious problem is that the generator assumes that both Door objects are the same type. Incidentally, hibernate does hbm2ddl on this type of association properly (there are two columns and two foreign keys created in the db).

      Thoughts? Am I missing something or a custom mapping that I can provide the seam utility?

      Thanks,
      Jason