Hibernate currencly can automatically choose the hibernate type to use when a the mapping doesn't specify the type property.
Can this system be extended to support user types ?
For example, say I want to use Joda-Time DateTime and YearMonthDay classes for my persistent properties.
Code:
class Booking {
private org.joda.time.DateTime dts;
private org.joda.time.YearMonthDay checkinDate;
// getters and setters
}
in my mapping I would like to be able to do :
Code:
<typedef
class='hidahibernate.DateTimeUserType'
name='jodaDateTime'
/>
<typedef
class="hidahibernate.YearMonthDayUserType'
name='jodaYearMonthDay'
/>
<class name='Booking'>
<property name='dts'/>
<property name='checkinDate'/>
</class>
Then some how specify a strategy to resolve property classes org.joda.time.YearMonthDay and org.joda.time.DateTime to user types named 'jodaYearMonthDay' and 'jodaDateTime'.