Bummer.

Can I put a BMP style Finder method in a CMP bean? I guess there really is
no stopping me... I guess that is my only option.

Thanks,
Hunter

> From: Dain Sundstrom <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> Date: Tue, 28 Jan 2003 12:05:57 -0600
> To: [EMAIL PROTECTED]
> Subject: Re: [JBoss-user] Getting Distinct to Use UCASE() or UPPER() in
> JBossQL or DeclaredSQL??
> 
> Hunter,
> 
> There is no way to do this with EJB-QL or JBossQL.  The problem is we
> don't support functions in the SELECT clause.  This is planned for 4.0
> but that doesn't help you.  I think the only way to implement this it
> to use a BMP style finder method.
> 
> Sorry,
> 
> -dain
> 
> On Tuesday, January 28, 2003, at 11:47 AM, Hunter Hillegas wrote:
> 
>> I am trying to get the following query to the DB:
>> 
>> SELECT DISTINCT UPPER(vendor) FROM sample_request_line_item WHERE
>> vendor IS
>> NOT NULL ORDER BY vendor;
>> 
>> EJBQL has no UPPER or UCASE, so it is out.
>> 
>> I tried JBossQL as such:
>> 
>> SELECT DISTINCT UCASE(s.vendor) FROM SampleRequestLineItemBean s WHERE
>> s.vendor IS NOT NULL ORDER BY s.vendor
>> 
>> That resulted in a parse error:
>> 
>> Caused by: org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered
>> "UCASE" at line 1, column 17.
>> Was expecting one of:
>>     "OBJECT" ...
>>     <NUMERIC_VALUED_PATH> ...
>>     <STRING_VALUED_PATH> ...
>>     <DATETIME_VALUED_PATH> ...
>>     <BOOLEAN_VALUED_PATH> ...
>>     <ENTITY_VALUED_PATH> ...
>>     <VALUE_CLASS_VALUED_PATH> ...
>> 
>> Ok.... So I am now looking at declaredSQL from Dain's docs...
>> 
>> But to specify distinct there, you just insert a tag. Also, the select
>> tags
>> just contain the EJB name and would look like this:
>> 
>> <declared-sql>
>> <select>
>>     </distinct>
>>     <ejb-name>SampleRequestLineItemBean</ejb-name>
>>     <alias>lineItem</alias>
>> </select>
>> ...
>> </declared-sql>
>> 
>> It doesnąt look like I can insert the logic there...
>> 
>> Any ideas? The raw SQL runs on the database (PostgreSQL) just fine...
>> 
>> JBoss 3.2.0 RC1 on MacOS X 10.2.x.
>> 
>> Thanks,
>> Hunter
>> 
>> 
>> 
>> -------------------------------------------------------
>> This SF.NET email is sponsored by:
>> SourceForge Enterprise Edition + IBM + LinuxWorld  Something 2 See!
>> http://www.vasoftware.com
>> _______________________________________________
>> JBoss-user mailing list
>> [EMAIL PROTECTED]
>> https://lists.sourceforge.net/lists/listinfo/jboss-user
> 
> 
> 
> -------------------------------------------------------
> This SF.NET email is sponsored by:
> SourceForge Enterprise Edition + IBM + LinuxWorld http://www.vasoftware.com
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to