Joined: Sun Jan 28, 2007 2:22 pm Posts: 3 Location: Menlo Park, CA
|
I've inherited a codebase that uses Middlegen to generate hbm.xml files from a MySQL database.
Hibernate has an option to specify the default value for a column in a mapping, and from what I can tell, Middlegen code detects default values, but it doesn't write them to the xml file. Is there a way to configure Middlegen to so do? I've hunted around for awhile but haven't been able to find the answer. Perhaps this isn't possible?
In particular, I'd like to be able to generated something like:
<property
name="created"
type="java.sql.Timestamp"
column="created"
default="CURRENT_TIMESTAMP" (<--- or whatever)
not-null="true"
length="19"
/>
I'd rather not have to edit xml files by hand and it seems a little redundant to indicate default values in the MySQL schema and the Java code.
Thanks for any help.
|
|