I am using hibernate, jpa 2.0, I can persist a OneToMany relationship ok but can't update it (by adding a new element), I have tried many methods and get 1 of two errors each time, "can't insert null into user_id" or "UserRoles is transient persist first". There seems to be no way to do this, are my annotations wrong. It seems it wants me to persist user roles first but if I try it tells me user_id can not be null, but I can't set user id only user object???
posted 10 years ago
got it working with this
eat bricks! HA! And here's another one! And a tiny ad!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop