db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <fisc...@seitenbau.net>
Subject RE: Criteria.setIgnoreCase() and boolean fields?
Date Fri, 01 Apr 2005 09:15:27 GMT




Robert,

what I still do not understand is why upper(apd_notification.IS_VALID) does
not work. I am no postgresql guru and I have no postgresql implementation
available now, but I thought that one can do an upper() on a char column.

can you do something like
describe (Apd_Notification);
(or whatever that command is in postgresql) in a postgresql console and see
if the IS_VALID column is indeed a char ?

If not, can you regenerate the sql to create the db and see what type the
IS_VALID column in Apd_Notification is generated ?
If yes, can you create a test table in postgresql with a char column and
see whether upper() works on that column ?

    Thomas


Robert Bowen <syg6@yahoo.com> schrieb am 01.04.2005 10:36:49:

> Hello Thomas, sorry about the delay.
>
> In my templates/sql/base/postgresql/db.props I have:
>
> BOOLEANCHAR = char
>
> In my build.properties I have:
>
> torque.database = postgresql
>
> My Java is the following:
>
> criteria.add(ApdNotificationPeer.IS_VALID, false);
>
> And the generated SQL is this:
>
> SELECT * FROM apd_notification
> WHERE UPPER(apd_notification.IS_VALID)=UPPER(0)
>
> If I change the Java to:
>
> criteria.add(ApdNotificationPeer.IS_VALID, "false");
>
> The Sql is:
>
> UPPER(apd_notification.IS_VALID)=UPPER('false')
>
> And the error is the same -- can't perform an UPPER()
> on a boolean field. So it seems the problem isn't with
> the UPPER(0) or (UPPER('false') but rather the
> UPPER(apd_notification.IS_VALID).
>
> I'd *love* to have a workaround ... Unfortunately I
> can't really just piece together a SQL statement and
> call the Peer.execute() because the SQL is veeeeery
> long.
>
> Still looking ...
> Bob
>
>
> --- Thomas Fischer <fischer@seitenbau.net> wrote:
>
> >
> >
> >
> >
> > Robert,
> >
> > please omit also the port number:
> >
> >
> http://issues.apache.org/scarab/issues/template/Confirm.vm/confirm/...
> >
> > Can you please check your db.props file in the
> > generator ? There it should
> > say
> > BOOLEANCHAR = char
> >
> > so the column in the database should be a char
> > column, and the upper()
> > should work.
> >
> > Are you sure you have set
> >
> > torque.database = postgresql
> >
> > in your generator properties file ?
> >
> >    Thomas
> >
> >
> > Robert Bowen <syg6@yahoo.com> schrieb am 31.03.2005
> > 12:19:52:
> >
> > > Hi Thomas,
> > >
> > > I am using Postgre 8.0.1 for Windoze, Torque 3.1.
> > >
> > > In my Torque schema I use data type BOOLEANCHAR,
> > but
> > > the field in the database itself is boolean. I
> > don't
> > > think there is a 'boolchar' option, or anything
> > > similar in Postgre. I guess that's why it's
> > crashing.
> > > Ideally Torque would recognize that it is a
> > boolean
> > > field and not try to perform an UPPER() on it.
> > >
> > > Incidentally, I registered for an account on
> > scarab
> > > and got a message to confirm my subscription.
> > > Unfortunately the link sent in the confirm email
> > is
> > > wrong:
> > >
> > >
> >
> http://localhost:38080/scarab/issues/template/Confirm.vm/confirm/...
> > >
> > > localhost!?
> > >
> > > I tried putting issues.apache.org and
> > www.apache.org
> > > instead of localhost but it doesn't work.
> > >
> > > Any idea?
> > >
> > > Tanky,
> > > Bob
> > >
> > >
> > > @seitenbau.net> wrote:
> > > >
> > > >
> > > >
> > > >
> > > > Robert,
> > > >
> > > > Which database and Torque version are you using
> > ?
> > > > To my knowledge, booleanchar is usually
> > implemented
> > > > as a char field in the
> > > > database (at least for oracle and Torque 3.1.1),
> > so
> > > > upper should work
> > > > there.
> > > >
> > > > by the way, Scarab is the issue tracker for
> > torqe:
> > > > http://issues.apache.org/scarab/issues
> > > > request a role as observer for Torque->Source
> > and
> > > > then you are able to
> > > > create issues
> > > >
> > > >      Thomas
> > > >
> > > >
> > > >
> > > > Robert Bowen <syg6@yahoo.com> schrieb am
> > 31.03.2005
> > > > 11:03:00:
> > > >
> > > > > I *am* using BOOLEANCHAR, and it still doesn't
> > > > work.
> > > > >
> > > > > I'll have to take a look at scarab, don't know
> > > > what it
> > > > > is!
> > > > >
> > > > > syg
> > > > >
> > > > > --- Thomas Fischer <fischer@seitenbau.net>
> > wrote:
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > Sounds like a bug to me. Can you please
> > enter
> > > > this
> > > > > > in scarab, including the
> > > > > > database and the torque version you use ?
> > > > > >
> > > > > > As a workaround, you can try to change your
> > > > > > datamodel such that you use the
> > > > > > data type booleanchar instead of boolean.
> > > > > >
> > > > > >    Thomas
> > > > > >
> > > > > > Robert Bowen <syg6@yahoo.com> schrieb am
> > > > 31.03.2005
> > > > > > 10:02:13:
> > > > > >
> > > > > > > Hello all. I have a class that sets a
> > whole
> > > > bunch
> > > > > > of
> > > > > > > conditions for a search. Most of the
> > fields I
> > > > > > search
> > > > > > > on are text so using
> > Criteria.setIgnoreCase()
> > > > has
> > > > > > been
> > > > > > > working.
> > > > > > >
> > > > > > > I recently added another search criteria,
> > on a
> > > > > > boolean
> > > > > > > field:
> > > > > > >
> > > > > > > criteria.add(NotificationPeer.IS_COMPLETE,
> > > > false);
> > > > > > >
> > > > > > > But since the setIgnoreCase() is set to
> > true
> > > > for
> > > > > > the
> > > > > > > Criteria, Torque tries to do an UPPER() on
> > a
> > > > > > boolean
> > > > > > > field!
> > > > > > >
> > > > > > > Can I avoid this somehow? Currently it
> > crashes
> > > > in
> > > > > > a
> > > > > > > rather ugly way ...
> > > > > > >
> > > > > > > Thanks!
> > > > > > > syg
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > __________________________________
> > > > > > > Do you Yahoo!?
> > > > > > > Make Yahoo! your home page
> > > > > > > http://www.yahoo.com/r/hs
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> ---------------------------------------------------------------------
> > > > > > > To unsubscribe, e-mail:
> > > > > > torque-user-unsubscribe@db.apache.org
> > > > > > > For additional commands, e-mail:
> > > > > > torque-user-help@db.apache.org
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail:
> > > > > > torque-user-unsubscribe@db.apache.org
> > > > > > For additional commands, e-mail:
> > > > > > torque-user-help@db.apache.org
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > __________________________________
> > > > > Do you Yahoo!?
> > > > > Yahoo! Small Business - Try our new resources
> > > > site!
> > > > > http://smallbusiness.yahoo.com/resources/
> > > > >
> > > > >
> > > >
> > >
> >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail:
> > > > torque-user-unsubscribe@db.apache.org
> > > > > For additional commands, e-mail:
> > > > torque-user-help@db.apache.org
> > > > >
> > > >
> > > >
> > > >
> > >
> >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
> > > > torque-user-unsubscribe@db.apache.org
> > > > For additional commands, e-mail:
> > > > torque-user-help@db.apache.org
> > > >
> > > >
> > >
> > >
> > >
> > > __________________________________
> > > Do you Yahoo!?
> > > Yahoo! Mail - Easier than ever with enhanced
> > search. Learn more.
> > > http://info.mail.yahoo.com/mail_250
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > torque-user-unsubscribe@db.apache.org
> > > For additional commands, e-mail:
> > torque-user-help@db.apache.org
> > >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > torque-user-unsubscribe@db.apache.org
> > For additional commands, e-mail:
> > torque-user-help@db.apache.org
> >
> >
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Read only the mail you want - Yahoo! Mail SpamGuard.
> http://promotions.yahoo.com/new_mail
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message