Hi,
I found the same problem when I was particularly interested in Hibernate performance. The solution is really easy (even I solved it) :-)
There is a property in tag class. I paste the content of Hibernate manual:
You may declare a persistent class using the class element:
Code:
<class
name="ClassName" (1)
table="tableName" (2)
discriminator-value="discriminator_value" (3)
mutable="true|false" (4)
schema="owner" (5)
proxy="ProxyInterface" (6)
dynamic-update="true|false" (7)
dynamic-insert="true|false" (8)
select-before-update="true|false" (9)
polymorphism="implicit|explicit" (10)
where="arbitrary sql where condition" (11)
persister="PersisterClass" (12)
batch-size="N" (13)
optimistic-lock="none|version|dirty|all" (14)
lazy="true|false" (15)
/>
(7) dynamic-update (optional, defaults to false): Specifies that UPDATE SQL should be generated at runtime and contain only those columns whose values have changed.
(8) dynamic-insert (optional, defaults to false): Specifies that INSERT SQL should be generated at runtime and contain only the columns whose values are not null.
Best regards.