hibernate 多对多关系详解(包括中间表,一对多字表)
2012-05-25 11:13:59 来源:WEB开发网核心提示: // Defensive, convenience methods .由PERSON端维护关系,inverse=”false”publicvoid addToEvent(Event event) {this.getEvents().add(event);event.getParticipant
// Defensive, convenience methods .由PERSON端维护关系,inverse=”false”
publicvoid addToEvent(Event event) {
this.getEvents().add(event);
event.getParticipants().add(this);
}
publicvoid removeFromEvent(Event event) {
this.getEvents().remove(event);
event.getParticipants().remove(this);
}
更多精彩
赞助商链接