Dimo,
I am not a Hibernate expert, and there might be some obscure configuration trick that allows you to do exactly what you want; but, in principle, it seems to me that parts of your question are contrary to the philosophy of Hibernate:
- you say that the DB does its own dependency checking "at commit time'. That suggests me that there is some commit command external to Hibernate.
Hibernate doesn't like that, since caching and determining when and what to commit accounts for a good deal of the framework's performance.
- You say that you don't want to be worried about the order in which objects are saved to the database. Well, if an object is defined, table-wise, as another object's parent, and that parent-child relationship is reflected in your Hibernate mappings, then Hibernate has no choice but to write those objects (whenever it deems necessary) in the right order. You can suspend referential integrity checking on an Oracle database with some Oracle code, but Hibernate will still execute the SQL commands in an order determined by the mapping files.
So, the short answer it: no, one cannot and should not void a parent-child check in Hibernate. If you don't want it to exist, simply don't specify on your mapping files, and ensure that integrity is maintained by some other (non-Hibernate) means.
_________________ Gonzalo Díaz
|