Hi,
I have a strange problem. I currentyl try to make a n:m relaationsship between two classes / tables THING and ACTION
One THING contains one or more actions, while an ACTION can be assigned to different THINGS.
So, I have a getter / setter in my THING class
public Collection getActions() {... }
Working with annotations, I added the following stuff at the getter:
@ManyToMany(
targetEntity=de.lerascura.ActionPO.class,
cascade={CascadeType.PERSIST, CascadeType.MERGE})
@JoinTable(
name="TBLACTIONREF",
joinColumns={
@JoinColumn(name="IMPORTER"),
@JoinColumn(name="NUMBER"),
@JoinColumn(name="YEAR")
},
inverseJoinColumns={
@JoinColumn(name="ACTION")
})
I start my program and it says "Here's your empty collection".. Nice. I forced Hibernate to output the statement and copy pasted it into a SQL editor. Everythings fine. I get a bunch of records, so also hibernate should get them, but instead the above mentioned getter just returns an empty collection?
Any idea what's going wrong here?
Best regards,
Andreas
|