Hibernate version: 3.2
Annotations version: 3.2
Hi All!
If I map my list as :
Code:
@OneToMany(targetEntity = Comment.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@Cascade( { org.hibernate.annotations.CascadeType.ALL, org.hibernate.annotations.CascadeType.DELETE})
@JoinTable(name = "appointment_comment", joinColumns = { @JoinColumn(name = "appointment_id") }, inverseJoinColumns = @JoinColumn(name = "comment_id"))
public List<IComment> getComments() {
return comments;
}
I get joined table without primary key, there are only foreign key and unique constraintes
What should I specify, to generate joined table whith composite primary key (appointment_id,comment_id) (DBUnit requirement).
The only way I know now it is replacing List by Set, in that case primary key is generated ;(
Code: