All,
Interface UserType has:
Code:
Class returnedClass();
Object nullSafeGet(ResultSet rs, String[] names, Object owner);
I am working with a domain model in which entities have strongly typed properties (which are business-specific but all extend BigDecimal). These properties are mapped to the same SQL type.
Instead of having one UserType implementation per property type, I would like to have a single implementation that returns the right instance depending on the target property.
Does the UserType interface cover this scenario? Is it possible to have returnedClass() return different classes depending on the target property? If so, how can I determine the class of the current property within nullSafeGet(...)?
Any help will be appreciated.