baliukas wrote:
if you can not validate/transform data before import (It can be too slow in some cases) drop FK and ignore invalid rows. I do not think hibernate can clear garbage faster than import procedures.
The data that we are importing is good. We are basically importing our product model. The deal is that before we re-import we delete the current product model in the DB, and then import new one. So it is possible that some of the products do not exist after the re-import. We then need to clean-up the objects that are refencing these non-existent products. We disable FK's at start of load and then enable them after all clean-up.
The issue is we want to use Hibernate delete to do clean-up to take advantage of cascading and object heirarchies. Otherwise clean-up becomes maintenance nightmare through JDBC.
So why is it that Hibernate must complain about invalid references during a delete? We are only trying to get rid of that which Hibernate is complaining about.
Does this make sense? This seems like a valid scenario, is nobody else doing something similar?