I have a Grails project that uses Hibernate XML with domain classes in the src/groovy folder. I am upgrading from 1.0.3 to 1.3.7. The Hibernate XML has custom column names for some properties and the domain classes use those properties. However, when I run the application it generates new columns for the properties as if they didn't have a column property:
XML for User:
<class name="User" table="x_users">
<cache usage="read-write"/>
<comment>User</comment>
...
<property name="emailAddress" column="emailAddress"/>
...
</class>
</hibernate-mapping>
Domain for User (in src/groovy):
package com.x.domain
class User {
...
String emailAddress
...
}
This results in the column email_address being created upon running the applications. Any ideas?
UPDATE:
Even if I add mappings to the domain class, it STILL creates the new column:
class User {
static mapping = {
emailAddress column:'emailAddress'
}
}