mmxbass 2 Light Poster

I am having problems persisting a ManyToMany relationship using Toplink and entity objects created automaticaly by Netbeans. I have attached the relevant entity objects as Data.zip. My problem is this:

Chapter and Strand have a ManyToMany relationship as you can see in the entity objects. A strand contains multiple chapters but the same chapter may appear in more than one strand. When I change the chapter object, i call setBody(), setName() etc and when I commit() the transaction, everything is persisted to those fields, that part works fine. The problem crops up when I call setStrandCollection() on my chapter and pass it a vector of strands. When I commit the transaction. The application behaves as though the data is persisted (when I go to another chapter and come back, the reloaded chapter has the changes) but it doesn't actually write the change to the tables. When I look in phpMyAdmin, the changes to the relationship table were never made although all other changes (from the same transaction) were made correctly.

I'm concerned that perhaps the classes generated by netbeans need some cleanup but I'm not sure where or how.

Any thoughts/suggestions?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.