Hi,
Thanks for your reply. I've already set both the properties
Code:
order_inserts, order_updates
to true.
The issue is let's say, 1 object contains heterogeneous data, so when I save that object, prepared insert statements are generated in following order.
insert into TABLE (COL1, COL2, CLASS_, ID_) values (?, ?, 'A', ?)
insert into TABLE (COL1, COL2, CLASS_, ID_) values (?, ?, 'B', ?)
insert into TABLE (COL1, COL2, CLASS_, ID_) values (?, ?, 'C', ?)
Now, when multiple objects are being inserted, insert statements are generated as follows
insert into TABLE (COL1, COL2, CLASS_, ID_) values (?, ?, 'A', ?)
insert into TABLE (COL1, COL2, CLASS_, ID_) values (?, ?, 'B', ?)
insert into TABLE (COL1, COL2, CLASS_, ID_) values (?, ?, 'C', ?)
insert into TABLE (COL1, COL2, CLASS_, ID_) values (?, ?, 'A', ?)
insert into TABLE (COL1, COL2, CLASS_, ID_) values (?, ?, 'B', ?)
insert into TABLE (COL1, COL2, CLASS_, ID_) values (?, ?, 'C', ?)
Due to this (different prepared statement), it seems I cannot get the advantage of batch insert, in which one prepared statement is generated and then single insert statement with multiple values.
So, I was thinking that if somehow when prepared statement is generated if we can ignore the discriminator value and while actually inserting values considers the discriminator value. This way it would be possible to get the advantage of batch insert.
Event when single object is being inserted and if somehow, we eliminate discriminator value from prepared statement then in above example only 1 insert prepared statement would be created and execute statement would contain multiple values.
Thanks,