Hibernate dynamic-insert and dynamic-update
When the dynamic-insert property is set to true , Hibernate does not include null values for properties (for properties that aren’t set by the application) during an INSERT operation. With the dynamic-update property set to true, Hibernate does not include unmodified properties in the UPDATE operation.
This can be specified either via XML:
<class name="MyCar" table="CAR" dynamic-insert="true" dynamic-update="true">
or using annotations:
@Entity @org.hibernate.annotations.Entity(dynamicInsert = true, dynamicUpdate = true) @Table (name="CAR")