Hi
Hibernate applies select query before inserting an Object into DB.
I.e.
I have an object of ClassC, which has list of ClassD objects.
Then I have an Object of ClassA and Object of ClassB, which share common object ClassC,
Now I have two problem
1) First when I store an Object of ClassC, so along with inserting instance of ClassC hibernate will also insert all objects of classd which are in list of classc, but before it insert these objects it applies select for classd table which kills the performance.
2) Now I am going to insert an object of ClassB and ClassA, which share common object of ClassC and we inserted it before even though it applies select query for classc while storing objects of classb and classa, so it also cause to pour performance.
So can any one help me in telling hibernate that classc instance is already inserted so no need to apply select query?
Or any other ways through which hibernate does not apply select query.
Note: I have already tried with second level cache but it does not help me in above.
|