@Entity
@Table(schema = "test", name = "t_primary")
public class Primary implements Serializable {
@Id
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "t_secondary_id")
private Secondary secondary;
private String name;
@Entity
@Table(schema = "test", name = "t_secondary")
public class Secondary implements Serializable {
@Id
private int id;
private String name;
@Column(name = "second_name")
private String secondName;