Bugs item #835596, was opened at 2003-11-04 10:51
Message generated for change (Comment added) made by letiemble
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=835596&group_id=22866
Category: JBossCMP
Group: v3.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Panagiotis Korros (pkorros)
Assigned to: Nobody/Anonymous (nobody)
Summary: Can't use ORDER BY for boolean cmp fields
Initial Comment:
When i try to execute the following EJB-QL statement:
SELECT OBJECT( o ) FROM Position o ORDER BY o.organic ASC
I get the following error:
javax.ejb.FinderException: Error compiling ejbql:
org.jboss.ejb.plugins.cmp.ejbql.ParseException:
Encountered "o.organic" at line 1, column 48.
Was expecting one of:
<NUMERIC_VALUED_PATH> ...
<STRING_VALUED_PATH> ...
<DATETIME_VALUED_PATH> ...
at
org.jboss.ejb.plugins.cmp.jdbc.JDBCDynamicQLQuery.execute(JDBCDynamicQLQuery.java:92)
at
org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCSelectorBridge.execute(JDBCSelectorBridge.java:64)
at
org.jboss.ejb.plugins.cmp.bridge.EntityBridgeInvocationHandler.invoke(EntityBridgeInvocationHandler.java:91)
at
org.jboss.proxy.compiler.Runtime.invoke(Runtime.java:59)
at
orgchart.ejb.PositionCMP$Proxy.ejbSelectGeneric(<generated>)
o.organic is a Boolean CMP Field of Position bean.
----------------------------------------------------------------------
>Comment By: Laurent Etiemble (letiemble)
Date: 2003-11-07 15:29
Message:
Logged In: YES
user_id=437455
Here is what I found in the EJB specs 2.1.
Chapter 11.2.7.2 :
"Arguments to the functions MAX and MIN must correspond to
orderable cmp-field types (i.e., numeric types, string
types, character types, or date types)."
Chapter 11.2.8 :
"In the first two cases, each orderby_item must be an
orderable cmp-field of the entity bean abstract
schema type value returned by the SELECT clause. In the
third case, the orderby_itemmust evaluate to
the same cmp-field of the same entity bean abstract schema
type as the cmp_path_expression in the
SELECT clause."
Chapter 11.2.12 :
"Boolean comparison is restricted to = and <>."
These paragraphs seems to indicate that a boolean value
cannot be used in the ORDER BY clause as boolean fields are
not considered as orderable cmp_field. In this case,
orderable means comparable and boolean values are not
comparable.
Any suggestions ?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=835596&group_id=22866
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development