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
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
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
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
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
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-
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
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
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
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"
>
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
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
--
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.
-
13 matches
Mail list logo