4 Replies Latest reply on Oct 21, 2005 9:50 AM by Matt Johnston

    JoinTable on Set of Strings

    Matt Johnston Newbie

      I am trying to map a OneToMany for a Set comprised of Strings
      My Code is

      @OneToMany(cascade=CascadeType.ALL)
       @JoinTable(table=@Table(name="attributes"),
       joinColumns=@JoinColumn(name="id_attributemap"),
       inverseJoinColumns=@JoinColumn(columnDefinition="varchar(50)",name="value"))
       public Set<String> getAttributes() {
       return this.attributes;
       }
      


      In the code, id_attributemap is the id of the parent object. The problem I am having is with the second column, the one with the String values. I cannot set the name, columnDefinition, etc. The only thing I can figure is that since the column does not actually map to another Entity, it is causing some problems. By default, the column is mapped as varchar(255) with a name of "elt". Is there a way to get this mapping to work correctly?