Hi,
I have a boolean field that I'd like to map to a string column in DB, so I wrote the following
annotation:
@ExternalValues({"true=TRUE", "false=FALSE"})
@Type(String.class)
@Column(name="is_verified")
private boolean isVerified;
And I got ClassCastException:
Caused by: java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.String
at org.apache.openjpa.enhance.ReflectingPersistenceCapable.pcProvideField(ReflectingPersistenceCapable.java:126)
at org.apache.openjpa.kernel.StateManagerImpl.provideField(StateManagerImpl.java:3012)
at org.apache.openjpa.kernel.StateManagerImpl.preFlush(StateManagerImpl.java:2827)
at org.apache.openjpa.kernel.PNewState.beforeFlush(PNewState.java:39)
... 29 more
Somehow the external value transfer didn't happen and the type cast failed. Any idea?
thank you
-Peter
_________________________________________________________________
Suspicious message? There’s an alert for that.
http://windowslive.com/Explore/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_broad2_122008
--
View this message in context: http://n2.nabble.com/Convert-boolean-to-String-type-using-ExternalValues-tp1659215p1659215.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.
|