日期:2014-05-16 浏览次数:20530 次
private Set believer= new HashSet(0); public void setBeliever(Set<Believer> believer){ this.believer= believer; } @OneToMany(cascade = { CascadeType.MERGE }, fetch = FetchType.LAZY, mappedBy = "God") public Set<Believer> getBeliever() { return believer; }
private God god; public void setGod(God god){ this.god= god; } @ManyToOne(cascade = {}, fetch = FetchType.LAZY) @JoinColumns({ @JoinColumn(name = "godid",nullable = false, insertable = false, updatable = false) }) public God getGod() { return god; }