I have 2 views mapped in hibernate to classes, view A has a foreign key reference to view B
To manage the underlying tables I have stored procedures defined for sql-insert, sql-update, and sql-delete on both class definitions for the views.
When I try to delete a row in view B, hibernate automatically is generating: update A set f_key_B=null where f_key_b={id for view B}
This causes an exception because view A is not updateable. If I could get hibernate to just not issue the update as it tries to maintain referential integrity, I could do this myself as a trigger in the database after the delete on view B.
Is there anyway to configure Hibernate to either: (A) let me handle this in the database (with triggers), or (B) force hibernate to call another stored procedure to maintain referential integrity? The problem with this option is that there are many foreign keys in the database, that would each need a stored procedure (for example if view A also has a foreign key to view or table C)
|