Hi
I try to do the homework of Lab 4321_jpa_mapping.
I create a class
@Entity
@Inheritance(strategy=InheritanceType.JOINED)
public class Person2 implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String name;
..
get()
..
set();
}
@Entity
public class Student2 extends Person2 {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int id;
private String school;
private double grade;
...
}
@Entity
public class Teacher extends Person2 {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int id
private String teach;
private int year;
...
}
I want to know if must put
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
In classes Student and Teacher. I try two time, but it doesn't work
I have this fault : Component ID j_idt13:id has already been found in
the view.
How can I fix that?
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/javaprogrammingwithpassion?hl=en