I'm trying to set up a unidirection one to many list association in my application. I've read that hibernate should handle populating the index column automatically, but when I tried it this was not happening. I've read that when using a bidirectional association the index has to be maintained manually (again, currently using unidirectional), so I tried this and it did work.
I wouldn't post here, but I downloaded just about every example application I can find from the external example apps page (
http://www.hibernate.org/27.html) and have not found 1 example of a list being used in an association. Does anybody have a simple example of this? I'd like to see one that works as expected (hibernate handles index column) and compare those settings to my settings.
Also, in this type of relationship, how would the foreign key be set on the many end of the association? Is there any way to get that populated simply by added the entity to the list? After adding code to manually handle the list index, the code was still bombing because the foreign key was null.
Basically, it seems like something in my mapping is making it look like a bidirectional relationship, even though its set up as a single.