hibernate cascade - update child to null -


i have 1 many relationship between event , session. i'd cascade update event fk in session null when delete corresponding event. clue how this? , advance.

hibernate or jpa unfortunately don't have cascade type 'set null' should able @preremove

on 1 side (owner):

@onetomany(mappedby="whatever") public list<someentity> getsomeentity(){     return someentity; }  @preremove public void ondelete(){     for(someentity se : getsomeentity()){         se.setowner(null);      } } 

hope helps.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -