0 Replies Latest reply on Sep 20, 2006 11:21 AM by Taud Anas

    javax.persistence.GeneratorType  cannot be resolved

    Taud Anas Newbie

      I install JBossIDE-1.6.0.GA-Bundle-win32 and jboss-4.0.4.GA

      I create a new EJB3 project

      I create the folowing EntityBean :

      ----------------------------------------------------------------------------------
      import java.io.Serializable;
      import java.util.Collection;
      import javax.persistence.CascadeType;
      import javax.persistence.Column;
      import javax.persistence.Entity;
      import javax.persistence.FetchType;
      import javax.persistence.GeneratorType;
      import javax.persistence.Id;
      import javax.persistence.JoinColumn;
      import javax.persistence.OneToMany;
      import javax.persistence.Table;

      @Entity
      @Table(name = "COUNTRY")
      public class CountryEntity implements Serializable {

      int numCountry;
      String labelCountry;
      String code2Country;
      String code3Country;
      private Collection persons;

      @Id( generate = GeneratorType.AUTO)
      @Column (name = "NUM_COUNTRY")
      public int getNumCountry() {
      return numCountry;
      }

      public void setNumCountry(int numCountry) {
      this.numCountry = numCountry;
      }

      @Column (name = "LABEL_COUNTRY")
      public String getLabelCountry() {
      return labelCountry;
      }

      public void setLabelCountry(String labelCountry) {
      this.labelCountry = labelCountry;
      }

      @Column (name = "CODE2_COUNTRY")
      public String getCode2Country() {
      return code2Country;
      }

      public void setCode2Country(String code2Country) {
      this.code2Country = code2Country;
      }

      @Column (name = "CODE3_COUNTRY")
      public String getCode3Country() {
      return code2Country;
      }

      public void setCode3Country(String code3Country) {
      this.code3Country = code3Country;
      }

      @OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="country")
      @JoinColumn(name="FK_COUNTRY") // Foreign key in PERSON
      public Collection getPersons() {
      return persons;
      }

      public void setPersons(Collection persons) {
      this.persons = persons;
      }
      }
      ----------------------------------------------------------------------------------

      But the Eclipse IDE do not reconise the class javax.persistence.GeneratorType

      "The import javax.persistence.GeneratorType cannot be resolved"