Regular |
|
Joined: Mon Sep 20, 2004 8:42 am Posts: 58 Location: Boston, US
|
Does Hibernate support expressing default values for certain columns to be specified in the mapping file such that the DDL also had them when SchemaExport is run.
I can initialize the member variable in my domain object to the default value or use a UserType however I would rather put them in my mapping file for a couple of reasons
- It will be along with related meta attributes like length, index, type etc. that are used to generate the DDL and more importantly
- not all my data read/insert is going to be through the application using Hibernate as the O/R mapper. We need to import bulk data from an external source using tools like Informatica. Placing the same default values in this tool is also possible but would be duplicate information that needs to be synch'ed and maintained.
Thanks,
Sanjiv
|
|