Hi all,
I'm doing some performance tests on a Java program using Hibernate and when I had a closer look on what kind of queries are generated by hibernate I was a bit surprised.
I explained myself. Basically, my program manages tables linked with a simple foreign key and when I'm inserting records in those tables. hibernate is using one insert sql statement per table and one sql statement to update the foreign key to link the tables.
So, If I'm right, for two tables linked by a foreign key, there are three queries and I was wondering if it was possible to reduce to two.
Instead of doing an update of the foreign key column, will it be possible to do 2 inserts with the value of the foreign key?
If someone understood me ;) and have a clue to do it, please let me know
Thanks
|