
Originally Posted by
huima
Hi,
I noticed strange behaviour on our system when using HibernateTemplate in Spring - compared to doing same thing with just Hibernate session.
We have a node-table where child-parent relationship is described and each node has parent_id. Table has also an index column that we would like to have a not null constraint. This works ok in simple testcase when using just hibernate session, however when we use HibernateTemplate I noticed that hibernate behaves differently:
1) insert into nodes (title, state, parent_id, owner_group_id, id) values (?, ?, ?, ?, ?)
2) Hibernate: update nodes set parent_id=null, position=null where parent_id=? and position=?
3) Hibernate: update nodes set parent_id=?, position=? where id=?
Any ideas or thoughts would be helpfull.