Todd,

You could use a CAST or CONVERTmethod in the SQL statement itself to do 
the transformation to varchar.

Best regards,

Mark Gillen
Senior Software Engineer
Assurant Corporate Technology (ACT)
Business & Enterprise Application Services
Miami -T-2, Technology Bldg.

(305) 253-2244 Ext. 32013
[email protected]



Todd Langdon <[email protected]> 
05/06/2009 12:52 PM
Please respond to
[email protected]


To
[email protected]
cc

Subject
Casting from INTEGER database field to String Object property in 
ResultMap?






Hi,

I have a value that is stored as an Integer in the database but it is a 
string on my domain object.  Is there no way to accomplish this via the 
ResultMap alone?  It was giving me a "Specifed cast is not valid" until I 
implemented a TypeHandlerCallback and specified it in the result 
typeHandler attribute - is that the only way to handle type mismatches 
between the persistence and object layers?

Thanks in advance,
Todd


**************************************************************************************
This e-mail message and all attachments transmitted with it may contain legally 
privileged and/or confidential information intended solely for the use of the 
addressee(s). If the reader of this message is not the intended recipient, you 
are hereby notified that any reading, dissemination, distribution, copying, 
forwarding or other use of this message or its attachments is strictly 
prohibited. If you have received this message in error, please notify the 
sender immediately and delete this message and all copies and backups thereof.

Thank you.
**************************************************************************************

Reply via email to