Jay,
Obviously, that is why I said that converting the finder query to lower
case is not correct.
Here is the changed code in JDBCFinderCommand.
if (lcQuery.startsWith(",") || lcQuery.startsWith("inner join")) {
//this is the case of a 'where' that is build to actually join
tables:
// ,table2 as foo where foo.col1 = entitytable.col2 AND
entitytable.filter = {1}
// or
// inner join table2 on table2.col1 = entitytable.col2 AND
entitytable.filter = {1}
String tableList = null;
int whereStart = lcQuery.indexOf("where");
if (whereStart == -1) {
//log this at debug in case someone has made a mistake, but
assume that
// they mean a findAll.
log.debug("Strange query for finder "+f.getName()+
". Includes join, but no 'where' clause. Is this a
findAll?");
tableList = query;
whereClause = "";
} else {
tableList = query.substring(0, whereStart);
whereClause = query.substring(whereStart);
}
fromClause = "FROM "+jawsEntity.getTableName()+tableList;
} else {
fromClause = "FROM "+jawsEntity.getTableName();
if (lcQuery.startsWith("where"))
whereClause = query;
else
whereClause = "where "+query;
}
Vinay
----- Original Message -----
From: "Jay Walters" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 03, 2001 2:03 PM
Subject: RE: [JBoss-dev] [ jboss-Bugs-438115 ] JAWS lower-cases custom
finder SQL text
> They are all case sensitive when it comes to the data...
>
> -----Original Message-----
> From: Vinay Menon [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 03, 2001 8:59 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [JBoss-dev] [ jboss-Bugs-438115 ] JAWS lower-cases custom
> finder SQL text
>
>
> Dan,
> Oracle case sensitive as well. One of the chaps here put a finder
query
> ... "where flg='T'"
>
> Obviously it didn't work cos the JDBCDefinedFinderCommand issued it to
> the backed as "where flg=i't'". This is cos the where clause is
constructed
> with the lower case query. Do you want me to fix it?
>
> Vinay
>
> ----- Original Message -----
> From: "danch" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, July 03, 2001 4:17 AM
> Subject: Re: [JBoss-dev] [ jboss-Bugs-438115 ] JAWS lower-cases custom
> finder SQL text
>
>
> > Does anybody know what databases are case sensitive WRT column and table
> > names (or even keywords). I've never run into case sensitive SQL
> > databases before.
> >
> > [EMAIL PROTECTED] wrote:
> >
> > > Bugs item #438115, was opened at 2001-07-02 19:50
> > > You can respond by visiting:
> > >
>
http://sourceforge.net/tracker/?func=detail&atid=376685&aid=438115&group_id=
> 22866
> > >
> > > Category: JBossCMP
> > > Group: v2.4 BETA (stable)
> > > Status: Open
> > > Resolution: None
> > > Priority: 5
> > > Submitted By: Michael Jara (mjara)
> > > Assigned to: Nobody/Anonymous (nobody)
> > > Summary: JAWS lower-cases custom finder SQL text
> > >
> > > Initial Comment:
> > > JAWS is now lower-casing all custom finder SQL text
> > > specified in jaws.xml. Most database drivers seem to
> > > ignore case, but some (such as JConnect5.2/SybaseASE)
> > > do not.
> > >
> > > For example, if I have this in my jaws.xml file:
> > >
> > > <entity>
> > > <ejb-name>EventDescription</ejb-name>
> > > <finder>
> > > <name>findByEventType</name>
> > > <query>, TypeDescriptionPair,
> > > EventType WHERE EventType.description={0} AND
> > > EventType.enumerationIndex=TypeDescriptionPair.eventTyp
> > > eKey AND
> > > TypeDescriptionPair.eventDescriptionKey=EventDescriptio
> > > n.enumerationIndex</query>
> > >
> > > <order>EventDescription.description</order>
> > > </finder>
> > > </entity>
> > >
> > > All table and field names are lower-cased on
> > > execution. This is the trace logged in Beta 2.4:
> > >
> > > 2001-07-02 20:39:22,195 [RMI TCP Connection(8)-
> > > 161.218.184.161] DEBUG JAWS - findByEventType command
> > > executing: SELECT EventDescription.enumerationIndex,
> > > EventDescription.description FROM EventDescription,
> > > typedescriptionpair, eventtype where
> > > eventtype.description=? and
> > > eventtype.enumerationindex=typedescriptionpair.eventtyp
> > > ekey and
> > > typedescriptionpair.eventdescriptionkey=eventdescriptio
> > > n.enumerationindex ORDER BY
> > > EventDescription.description
> > > 2001-07-02 20:39:22,195 [RMI TCP Connection(8)-
> > > 161.218.184.161] DEBUG JAWS - Set parameter: idx=1,
> > > jdbcType=VARCHAR, value=Construction
> > > 2001-07-02 20:39:22,285 [RMI TCP Connection(8)-
> > > 161.218.184.161] DEBUG JAWS -
> > > com.sybase.jdbc2.jdbc.SybSQLException: The column
> > > prefix 'eventdescription' does not match with a table
> > > name or alias name used in the query. Either the table
> > > is not specified in the FROM clause or it has a
> > > correlation name which must be used instead.
> > >
> > > This DOES work properly in release 2.2 (maintaining
> > > case as entered in jaws.xml.)
> > >
> > > ----------------------------------------------------------------------
> > >
> > > You can respond by visiting:
> > >
>
http://sourceforge.net/tracker/?func=detail&atid=376685&aid=438115&group_id=
> 22866
> > >
> > > _______________________________________________
> > > Jboss-development mailing list
> > > [EMAIL PROTECTED]
> > > http://lists.sourceforge.net/lists/listinfo/jboss-development
> >
> >
> >
> > _______________________________________________
> > Jboss-development mailing list
> > [EMAIL PROTECTED]
> > http://lists.sourceforge.net/lists/listinfo/jboss-development
>
>
> _______________________________________________
> Jboss-development mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-development
>
> _______________________________________________
> Jboss-development mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-development
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development