Re: Boolean2IntFieldConversion with TINYINT

2005-09-08 Thread Thomas Franke
Thomas Dudziak wrote: > Therefore you'll have to either use BIT as the JDBC column type or > write your own Boolean2Byte conversion (simply copy the code of the > Boolean2Int conversion and replace Integer with Byte). That's true. We have also our own conversions for example a Long2Calender conver

Re: Boolean2IntFieldConversion with TINYINT

2005-09-07 Thread Thomas Dudziak
On 9/7/05, Daniel Perry <[EMAIL PROTECTED]> wrote: > True. > > Although surely if you're passing an item through the conversion, it > requires the conversion every time, so the default behaviour *should* never > happen. So, checking the extra types should only impact cases where you've > not used

RE: Boolean2IntFieldConversion with TINYINT

2005-09-07 Thread Daniel Perry
s in class file) to people using it properly! Daniel. > -Original Message- > From: Thomas Dudziak [mailto:[EMAIL PROTECTED] > Sent: 07 September 2005 15:36 > To: OJB Users List > Subject: Re: Boolean2IntFieldConversion with TINYINT > > > On 9/7/05, Daniel Perry &l

Re: Boolean2IntFieldConversion with TINYINT

2005-09-07 Thread Thomas Dudziak
On 9/7/05, Daniel Perry <[EMAIL PROTECTED]> wrote: > Hmm... What about modifying Boolean2IntFeild itself so it handles both: Yes, this would be possible but the instanceof's have a possibly significant runtime cost, esp. since you would want to also handle Short, Long and possibly Character as

RE: Boolean2IntFieldConversion with TINYINT

2005-09-07 Thread Daniel Perry
B Users List > Subject: Re: Boolean2IntFieldConversion with TINYINT > > > On 9/7/05, Daniel Perry <[EMAIL PROTECTED]> wrote: > > > The following works fine: > > > > /** > > * @ojb.field jdbc-type="INTEGER" > > * > > > conversion

Re: Boolean2IntFieldConversion with TINYINT

2005-09-07 Thread Thomas Dudziak
On 9/7/05, Daniel Perry <[EMAIL PROTECTED]> wrote: > The following works fine: > > /** > * @ojb.field jdbc-type="INTEGER" > * > conversion="org.apache.ojb.broker.accesslayer.conversions.Boolean2IntFieldCo > nversion" > */ > protected boolean deleted; > > But, if you use: > > @ojb.field jdbc-

RE: Boolean2IntFieldConversion with TINYINT

2005-09-07 Thread Daniel Perry
er 2005 09:18 > To: OJB Users List > Subject: Re: [junk] Re: Boolean2IntFieldConversion with TINYINT > > > On 9/7/05, Daniel Perry <[EMAIL PROTECTED]> wrote: > > What i mean, is that you cant do: > > > > > name="deleted" > > column="deleted&q

Re: [junk] Re: Boolean2IntFieldConversion with TINYINT

2005-09-07 Thread Thomas Dudziak
On 9/7/05, Daniel Perry <[EMAIL PROTECTED]> wrote: > What i mean, is that you cant do: > > name="deleted" > column="deleted" > jdbc-type="TINYINT" > conversion="org.apache.ojb.broker.accesslayer.conversions.Boolean2IntFieldCo > nversion"/> > > It would make sense to use tinyint for booleans

Re: [junk] Re: Boolean2IntFieldConversion with TINYINT

2005-09-07 Thread Thomas Franke
Daniel Perry wrote: > What i mean, is that you cant do: I see. > Problem is... i am using xdoclet to make the repository and torque to make > the database. So, i have to use INTEGER in the xdoclet comment, so it ends > up as integer in the database. I previously have put it as INTEGER then > us

RE: [junk] Re: Boolean2IntFieldConversion with TINYINT

2005-09-07 Thread Daniel Perry
ject: [junk] Re: Boolean2IntFieldConversion with TINYINT > > > Daniel Perry wrote: > > > Boolean2IntFieldConversion mapped as a TINYINT - it MUST be INTEGER!!! > I don't know what you exactly mean but we use this and it works out fine. > >name="deleted" >

Re: Boolean2IntFieldConversion with TINYINT

2005-09-06 Thread Thomas Dudziak
On 9/6/05, Daniel Perry <[EMAIL PROTECTED]> wrote: > A warning to anyone else who might try this: > > Just been struggling with IllegalArgumentExceptions on boolean fields. > Anyway, it turns out that you cant have a boolean with > Boolean2IntFieldConversion mapped as a TINYINT - it MUST be INTEGE

Re: Boolean2IntFieldConversion with TINYINT

2005-09-06 Thread Thomas Franke
Daniel Perry wrote: > Boolean2IntFieldConversion mapped as a TINYINT - it MUST be INTEGER!!! I don't know what you exactly mean but we use this and it works out fine. In the database the data type is tinyint. Regards, Thomas --

Boolean2IntFieldConversion with TINYINT

2005-09-06 Thread Daniel Perry
A warning to anyone else who might try this: Just been struggling with IllegalArgumentExceptions on boolean fields. Anyway, it turns out that you cant have a boolean with Boolean2IntFieldConversion mapped as a TINYINT - it MUST be INTEGER!!! Daniel. -