Spring Data JPA one to one 共享主键关联

/**
* Created by xiezhiyan on 17-9-13.
*/
@Entity
public class Token {

@Id
@Column(name = "store_id")
private Long storeId;

@JsonIgnore
@OneToOne
@MapsId
@JoinColumn(name = "store_id")
private Store store;

private String value;

public Store getStore() {
return store;
}

public void setStore(Store store) {
this.store = store;
}

public Long getStoreId() {
return storeId;
}

public String getValue() {
return value;
}

public void setValue(String value) {
this.value = value;
}
}
posted @ 2017-09-13 03:43  涉谷猫猫  阅读(1619)  评论(0)    收藏  举报