Jan,

The JDBC Type mapping to java boolean is BIT.  The cast is working on a
save, but can't deal with the VARCHAR -> BIT conversion on load I
suspect.
http://jakarta.apache.org/ojb/jdbc-types.html

Wally

-----Original Message-----
From: Jan Zimmek [mailto:jzimmek@;morelogs.de] 
Sent: Tuesday, October 22, 2002 10:15 AM
To: OJB Users List
Subject: boolean and mysql problem


hi,

i have a class "TService" containing an attribute "enabled" of type
boolean.

public class TService
{
    boolean enabled;
    public TService() {}
    public setEnabled(boolean enabled) {}
    public setEnabled(String enabled) {}
}

in my repository i defined the jdbc-type of this column to be "VARCHAR".

it works fine if i create a new instance of "TService" and call the
broker to store this object, but when i try to fetch a collection of
results:

Query q = new QueryByCriteria(TService.class, new Criteria());
Collection results = broker.getCollectionByQuery(q);

ojb throws a PersistenceBrokerException:

Unable to build object instance: TService

hmm ... when i change the datatype of class-attribute "enabled" to
"String" it works ... but boolean always fail.

Any suggestions would be greatly appreciated.

regards
jan zimmek



--
To unsubscribe, e-mail:
<mailto:ojb-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail:
<mailto:ojb-user-help@;jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:ojb-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:ojb-user-help@;jakarta.apache.org>

Reply via email to