5 Replies Latest reply on Nov 21, 2005 5:43 PM by Bill May

    org.hibernate.AnnotationException: No identifier specified

    Bill May Newbie

      I am using JBoss-4.0.3, Eclipse 3.1 w/ JBoss EclipseIDE1.5M

      Here is my error:
      --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
      ObjectName: jboss.j2ee:service=EJB3,module=scheduler-beans.ejb3
      State: FAILED
      Reason: org.hibernate.AnnotationException: No identifier specified for entity: com.e2s.ejb.student.StudentRequest

      Here is my code:
      @Entity
      @Table(name = "StudentRequest")
      public class StudentRequest implements Serializable{

      private long studentId = -1;
      private int classType = -1;
      private int priority = -1;
      private long classDefinitonId = -1;
      private long sectionId = -1;
      private int prefWeight = -1;

      private ClassDefinition theClassDefinition = null;
      private Student student = null;

      public StudentRequest() {
      super();
      // TODO Auto-generated constructor stub
      }

      public ClassDefinition getClassDefinition()
      {
      theClassDefinition = new ClassDefinition();
      theClassDefinition.setId(classDefinitonId);
      return theClassDefinition;
      }

      public void setClassDefinition(ClassDefinition newClassDefinition)
      {

      if(newClassDefinition != null)
      {
      if(theClassDefinition != null)
      {
      //theClassDefinition.get
      }

      this.theClassDefinition = newClassDefinition;
      }
      }
      public long getClassDefinitonId() {
      return classDefinitonId;
      }

      public void setClassDefinitonId(long classDefinitonId) {
      this.classDefinitonId = classDefinitonId;
      }

      public int getClassType() {
      return classType;
      }

      public void setClassType(int classType) {
      this.classType = classType;
      }

      public int getPrefWeight() {
      return prefWeight;
      }

      public void setPrefWeight(int prefWeight) {
      this.prefWeight = prefWeight;
      }

      public int getPriority() {
      return priority;
      }

      public void setPriority(int priority) {
      this.priority = priority;
      }

      public long getSectionId() {
      return sectionId;
      }

      public void setSectionId(long sectionId) {
      this.sectionId = sectionId;
      }


      public long getStudentId() {
      return studentId;
      }

      public void setStudentId(long studentId) {
      this.studentId = studentId;
      }

      @ManyToOne
      @JoinColumn (name="studentId")
      public Student getStudent()
      {
      return student;
      }

      public void setStudent(Student student)
      {
      if(student != null)
      {
      this.student = student;

      this.student.addStudentRequest(this);
      }
      }

      }