Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Converting Strings to Boolean

And once again, you were right on the money. It made it surprisingly simple. Out of curiosity, I did not see any mention of converters in the JPA specification. Was this an oversight? I know I'm locking myself into EclipseLink by using these annotations, which is fine because I don't plan on changing implementations, but I was just curios as to why converters weren't specified in the spec.

Thanks for the help...

Chris Mathrusse
christopher.mathrusse@xxxxxxxxxx


From: Guy Pelletier <guy.pelletier@xxxxxxxxxx>
To: "EclipseLink User Discussions" <eclipselink-users@xxxxxxxxxxx>
Date: 12/18/2009 05:02 AM
Subject: Re: [eclipselink-users] Converting Strings to Boolean
Sent by: <eclipselink-users-bounces@xxxxxxxxxxx>





Hi Chris,
 
You can use an EclipseLink @ObjectTypeConverter to do this.
 
http://wiki.eclipse.org/Using_EclipseLink_JPA_Extensions_%28ELUG%29#How_to_Use_the_.40ObjectTypeConverter_Annotation
 
Cheers,
Guy
----- Original Message -----
From: Christopher.Mathrusse@xxxxxxxxxx
To: Eclipselink-Users
Sent: Thursday, December 17, 2009 7:02 PM
Subject: [eclipselink-users] Converting Strings to Boolean

I've got a legacy database that I'm playing with and it has many fields in the tables that should be defined as a BIT rather than CHAR or VARCHAR, but it is what it is.

How can I have EclipseLink convert these fields, that contain simple 'Y' and 'N', to Boolean?


As always, thanks for the help...


Chris Mathrusse

christopher.mathrusse@xxxxxxxxxx


_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


Back to the top