See below - I found this from an earlier post on the forums. I am having the same problem and am going to try this as a solution.
======================
Either set up the defaults in your pojos, or set the dynamic-insert="true" and dynamic-update="true" attributes on all of your class mappings. These attrbiutes mean that your insert and updates only write columns that have values (and in the case of updates of attached entities, dirty values), so the database defaults will apply to other columns.
The dynamic-X methods do slow your java code down fractionally, as the SQL has to be created on the fly. But if that's not a concern for you, this is the correct solution.
_________________
Code tags are your friend. Know them and use them.
_________________ ThomasT
|