Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Entity
- public class Person implements Serializable {
- private static final long serialVersionUID = 1L;
- @Id @GeneratedValue(strategy = GenerationType.IDENTITY)
- private int id;
- private String name;
- @OneToOne
- private Person test;
- @Entity
- public class PersonGroup implements Serializable {
- private static final long serialVersionUID = 1L;
- public enum PersonType{MALE,FEMALE}
- @Id @GeneratedValue(strategy = GenerationType.IDENTITY)
- private int id;
- private PersonType personType;
- @OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.EAGER)
- private Collection<Person> persons = new Vector<Person>();
- @Entity
- @Table(name="pairs")
- public class Pair implements Serializable {
- private static final long serialVersionUID = 1L;
- @Id @GeneratedValue(strategy = GenerationType.IDENTITY)
- private int id;
- @OneToOne
- private Person personA;
- @OneToOne
- private Person personB;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement