Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to convert string to Boolean using ObjectTypeConverter

662894Oct 1 2008 — edited Oct 1 2008
I am using 11g.

I am trying to convert a flag value which is stored in the database as Y or N.

I am trying to use the ObjectTypeConverter to do that however the code is throwing compilation error because both the Conversion value parameters are expected as String.

Please help. here is the code segment I am trying to use.

@ObjectTypeConverter (
name="booleanConverter",
dataType=java.lang.String.class,
objectType=java.lang.Boolean.class,
conversionValues={
@ConversionValue(dataValue="N", objectValue= new Boolean(false)),
@ConversionValue(dataValue="Y", objectValue=new Boolean(true))}
)

@Convert("booleanConverter")
public Boolean getDelivFlag()
{
return delivFlag;
}

Edited by: user5972543 on Oct 1, 2008 7:34 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 29 2008
Added on Oct 1 2008
1 comment
464 views