[Member]
@Entity
public class Member {
@Id @GeneratedValue
private Long id;
@Column(name="USERNAME")
private String username;
@OneToOne
@JoinColumn(name = "LOCKER_ID")
private Locker locker;
}
[Locker]
@Entity
public class Locker {
@Id @GeneratedValue
@Column(name = "LOCKER_ID")
private Long id;
private String name;
}
[Member]
@Entity
public class Member {
@Id @GeneratedValue
private Long id;
@Column(name="USERNAME")
private String username;
@OneToOne(mappedBy = "member")
private Locker locker;
}
[Locker]
@Entity
public class Locker {
@Id @GeneratedValue
@Column(name = "LOCKER_ID")
private Long id;
private String name;
@OneToOne
@JoinColumn(name = "MEMBER_ID")
private Member member;
}
[Member]
@Entity
public class Member {
@Id @GeneratedValue
private Long id;
@Column(name="USERNAME")
private String username;
@OneToOne(mappedBy = "member")
private Locker locker;
}
[Locker]
@Entity
public class Locker {
@Id @GeneratedValue
@Column(name = "LOCKER_ID")
private Long id;
private String name;
@OneToOne
@JoinColumn(name = "MEMBER_ID")
private Member member;
}