We have a Scenario wherein we need to delete a record before updating it. While deleting, we would also have to delete all the records from the Child tables associated with a foreign key. And we would have to re-insert all the records with the update to the parent table.
The reason why we would like to do this, is to bring the records which are being updated to the New Partitions in our Oracle database. This helps us to prune/delete the old partitions over time easily, since they are not being used (solely for maintenance purposes).
Is there an easy way in Hibernate to achieve this? We would like to do an Cascade-Delete on the Parent record, and Re-insert them with the updates (all the parent and child records) back into the database. Has anyone encountered similar issue before? Are there any other better solutions to pull the updated records to the new Partitions?
We resolved this issue by using Oracle Partitioning (Oracle11g) based on a Column name.