I am reversing some classes from tables using JPA annotations. But a few of the columns I need to map into custom types (ie, joda-time). When I add a hibernate-mapping file with the entity specifying only the id and the column with the type mapping, I get some weird errors.
I'm suspecting that the hibernate-mapping is completely overriding some aspects of the annotations as opposed to extending. Can just a few properties of an @Column be overriden? Is there any way to achieve this?
Code:
<hibernate-mapping>
<class name="com.foliofn.inteliclear.entities.IcCustProfile">
<id name="id" />
<property type="org.joda.time.contrib.hibernate.PersistentLocalDate" name="dob"/>
</class>
</hibernate-mapping>
Code:
@Entity
@Table(name = "cust_profile", uniqueConstraints = { @UniqueConstraint(columnNames = { "acct_no",
"corr", "office" }) })
public class IcCustProfile implements java.io.Serializable {
...
@Column(name = "dob", unique = false, nullable = true, insertable = true, updatable = true, length = 16)
public LocalDate getDob() {
return this.dob;
}
...
}