Hibernate version: 3.0rc1
Mapping documents:
Hi,
I am trying to make an "update" query into two statements to customize Hibernate to deal with historical data. An update query to me would look like:
insert into Object(startVersion, endVersion, name, objId) values (?, ?, ?, ?)
update Object SET endVersion=? where endVersion=-1
It seems like <sql-insert>my query</sql-insert> can only take a single statement. When I consider customizing the BasicEntityPersister class, this piece of code allows only one statement to be added the batch as an update statement.
Code:
BasicEntityPersister:1900
if ( useBatch ) {
session.getBatcher().addToBatch( 1 );
return true;
}
I am trying not to have to customize the persister too much.
After reading the forum, I gathered that I can use a stored procedure that takes parameters to achieve this.
Is stored procedure the suggested path to take?
Thanks!
Theen-Theen