5 Replies Latest reply on Sep 2, 2010 6:29 PM by folgerfonseca

    seam-gen not generating pages to @ManyToMany relationships

    tognado

      why doesn't seam-gen (seam generate-ui) create automagically session beans and xhtml pages to ManyToMany relationships ?


      I have an entity boy that contains a Set of toy entities. It seems that seam generate-ui created the mysql database correctly, Boy and Toy pages and sessions, but didn't create a page where I can associate boy to toys at all. Is that a miss use or seam does not provide this ? If seam does not provide, can anyone help me doing this ?


      ps: I am using jboss 4.2.3.ga, jboss 2.1.1-ga, jdk 1.5, ant 1.7, eclipse jee 3.4 and jboss tools (development version) in my debian box.


      Below you can read my very simple souce-code:


      BOY.JAVA


      @Entity
      public class Boy implements java.io.Serializable{
      
          private static final long serialVersionUID = 1L;
          private Long id;
          private String name;
          private Set<Toy> toys;
      
          @Id @GeneratedValue
          public Long getId() {
              return id;
          }
          public void setId(Long id) {
              this.id = id;
          }
      
          @NotNull
          public String getName() {
              return name;
          }
          public void setName(String name) {
              this.name = name;
          }
      
          @ManyToMany(cascade = CascadeType.PERSIST)
          public Set<Toy> getToys() {
              return toys;
          }
          public void setToys(Set<Toy> toys) {
              this.toys = toys;
          }
      
      }




      TOY.JAVA


      @Entity
      public class Toy implements java.io.Serializable{
      
          private static final long serialVersionUID = 1L;
          private Long id;
          private String name;
      
          @Id @GeneratedValue
          public Long getId() {
              return id;
          }
          public void setId(Long id) {
              this.id = id;
          }
      
          @NotNull
          public String getName() {
              return name;
          }
          public void setName(String name) {
              this.name = name;
          }
      }