gopinathcool wrote:
one of the field in my value object is String , which i need to map with one of the field in DB table of datatype Date. This object is mapped through XXX.hbm.xml
Since this value object is used in some other existing running application, i dont want to change the datatype of it.
If i change the property type as String in XXX.hbm.xml file, it gives error.
Please let me know the way to do this.
Regards
Gopinath
This is a problem I've dealt with recently. What you can do is instead of loading your value objects directly from hibernate, load another object (a dto or some other model...it doesn't really matter what you call it because it's only a pojo anyway). This object can have whatever data types you need for hibernate. THEN write a bridge that takes your hibernate-loaded object and loads your VO doing any type conversions along the way. It adds a couple classes but it leaves your VO as you need it for the rest of your application.
Regards,
Kyle