everyone! Sorry but I need some help. My db is looking this way, I try to do same throught the Hibernate in Java.
But I don`t understand how I need to annoted this relations with so many different tables. It`s a part of my Abiturient table.
@Entity
@Table (name = "abiturient",
uniqueConstraints = {@UniqueConstraint(columnNames = {"id"})})
public class Abiturient {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id", nullable = false, unique = true, length = 11)
@ManyToOne
private Long id;
@Column
private Date data_narodjennya;
@Column
private Integer city_village;
It`s a part of my nomer_telefonu table
@Entity
@Table(name = "nomer_telefonu")
public class NomerTelefonu {
@Id
@Column(name = "nomer_tel_id", nullable = false, unique = true, length = 11)
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long nomer_tel_id;
@Column(name = "nomer")
private String nomer;
@Column(name = "id")
@OneToMany(fetch = FetchType.LAZY)
private Set<Abiturient> id;
I don`t think that all there is right, `cos every time I try to solve problem I get an error and need other type.