mapping

Showing posts with label mapping. Show all posts
Showing posts with label mapping. Show all posts

The best way to map @OneToOne


@OneToOneThe best approach to bidirectional @OneToOne is to use @MapsIdStudent entity@Entity@Data@Table(name = "students")public class Student implements Serializable {     @Id     @GeneratedValue     private Integer id;     private...

The best way to map @ManyToMany


@ManyToManyMany to many relationships can be easily mapped by creating another table using @JoinTable as follows.Student entity@Data@Table(name = "Student")@Entitypublic class Student implements Serializable {     @Id     @GeneratedValue(strategy = GenerationType.AUTO)...