openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Tan <>
Subject Convert boolean to String type using ExternalValues
Date Mon, 15 Dec 2008 09:24:13 GMT


I have a boolean field that I'd like to map to a string column in DB, so I wrote the following

    @ExternalValues({"true=TRUE", "false=FALSE"})
    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(
    at org.apache.openjpa.kernel.StateManagerImpl.provideField(
    at org.apache.openjpa.kernel.StateManagerImpl.preFlush(
    at org.apache.openjpa.kernel.PNewState.beforeFlush(
    ... 29 more

Somehow the external value transfer didn't happen and the type cast failed. Any idea?

thank you

Send e-mail faster without improving your typing skills.
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message