in the application that I am working on, somebody split the domain objects into different persistence units. The connection between tables from different persistence units is made based on columns containing the ID for instance:
TableA TableB
ID:Int ID:int
Field1 TableA_ID:Int
Field2 ...
...
The TableA_ID
is just a plain int, no constraints are enforced on it. Now I need to delete the parent entity (let's say TableA
but also all the connected TableB
s entities). In case of a foreign key relation, this would be a plain and simple CASCADE delete. But in this case, how should I proceed? A DB Trigger - I would like to keep everything in JPA.
Thank you!