Thought inc.

The Dynamic O/R Mapping Company
     

CocoBase Technical Support Forums
For access to developer site with software download and doc's, please request CocoBase download and password
will be emailed to you. Response to posts will appear when answered by THOUGHT Support team.
NOTE:You must register separately with forum in order to post your questions, please click on register icon below.
Home   Frequently Asked Questions   Search   Edit your profile   Registration is free!  
Email This Page to Someone!
Show a Printable Version
CocoBase Enterprise O/R Forums > CocoBase Bug Reports
DB CHAR to Java Boolean conversion using Transparent Persistence
< Previous Thread     Next Thread >
Author
Thread    Post New Thread     Post A Reply
westaj
Member

Registered: Dec 2001
Posts: 1

We have a java object with a boolean data type. The mapped database stores this as a Char(1) field.

We are using transparent persistence with the CocoBase 4 runtime.

On an insert, the java object type is read and a '1' or '0' is written to the database. On a select, the fields are not set on the java object.

We've tried a primitive and Boolean type on the java object type.

Our field map is called :GST_APPLICABLE and our java field is called gstApplicable with a consistant getter and setter.

Is this a bug?

Cheers,

Aaron..

12-07-2001 02:33 PM
Click Here to See the Profile for westaj    Find more posts by westaj        Edit/Delete Message    Reply w/Quote    IP: Logged
admin
Administrator

Registered: Apr 2001
Posts: 19

This is a difficult question to answer as it would require
more information about what jdbc driver/database version you
are using, and it would require looking at your Map definition
to see how the mappings are set.

Generally CocoBase relies on the JDBC driver to do default
data conversions. This is defined by the jdbc driver
implementation so when getBoolean is called then the driver
would need to be able to convert your CHAR value to the
boolean properly for this to function as you expect.

If you're committed to the CHAR(1) data type, you may need to
do a conversion in the CocoProxyM wrapper that's used with
the Transparent Persistence facility. The source code to the
CocoProxyM wrapper can be found in the demos\pguide of the
distribution.

If you need for our engineers to look at your specific
example to see if the jdbc supports your conversion natively
please send a sample ddl, export a sample map from CocoAdmin
as XML and send a small sample test program with information
as to the database & jdbc version you're using. Then our
engineers can reproduce your testcase to see if this is
supported. Most likely the problem is that your jdbc driver
that you're trying to use doesn't natively support this
conversion however.

Typically for Boolean types most jdbc drivers convert the
true/false values into "true" and "false" in the database
so you'll need a CHAR(5) for the jdbc driver to function
properly.

Hope this helps!

THOUGHT Support

12-07-2001 11:36 PM
Click Here to See the Profile for admin    Find more posts by admin        Edit/Delete Message    Reply w/Quote    IP: Logged
All times are PST (US)    Post New Thread     Post A Reply
Forum Jump:
< Previous Thread     Next Thread >

Forum Rules:
Who Can Read The Forum? Any registered user or guest.
Who Can Post New Topics? Any registered user.
Who Can Post Replies? Any registered user.
Changes: Messages can be edited by their author. Messages can be deleted by their author.
Posts: HTML code is OFF. Smilies are OFF. vB code is OFF. [IMG] code is OFF.

Admin Options:
Open / Close Thread
Move Thread
Delete Thread
Edit Thread

< Contact Us - THOUGHT Inc. >

Copyright © Jelsoft Enterprises Limited 2000.
Copyright 2001 All Rights Reserved, THOUGHT Inc.