Bugs item #688743, was opened at 2003-02-19 03:41
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=428708&aid=688743&group_id=40712

Category: None
Group: None
>Status: Closed
>Resolution: Rejected
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
>Summary: Unable to use properties of type "object" in queries

Initial Comment:
Consider the mapping : 
 
    <class name="some.Class"> 
 
        <!-- ... --> 
 
        <property name="someProp" type="object"> 
            <column name="prop_class_name"/> 
            <column name="prop_id"/> 
        </property> 
 
    </class> 
 
It is invalid to use the property in the where clause of a select query, 
for example in : 
 
"select obj from obj in class some.Class where obj.someProp.id = ?" 
 
this raises an exception when calling list() on the Query : 
cirrus.hibernate.QueryException: dereferenced: someProp [select obj 
from obj in class some.Class where obj.someProp.id = ?] 
 at  
cirrus.hibernate.query.PathExpressionParser.token(PathExpressionParser.j  
ava:195) 
 at  
cirrus.hibernate.query.WhereParser.doPathExpression(WhereParser.java:363  
) 
.. 
 
 
 
it is not even possible to use the property without dereferencing it 
(and use the setEntity() method of Query to set the parameter) : 
 
"select obj from obj in class some.Class where obj.someProp = ?" 
 
raises an exception when calling list() on the Query : 
cirrus.hibernate.QueryException: path expression ends in a 
composite  
value [select obj from obj in class some.Class where obj.someProp = 
?] 
 at  
cirrus.hibernate.query.PathExpressionParser.getWhereColumn(PathExpressio  
nParser.java:348) 
 at  
cirrus.hibernate.query.WhereParser.doPathExpression(WhereParser.java:379  
) 
.. 
 
 
I suggest to add a special case into PathExpressionParser.token() to 
be able to use the special property "id" when dereferencing a property 
of type "object" in a where clause. 
 
Regards, 
 
-- 
Romain Lenglet 
 

----------------------------------------------------------------------

>Comment By: Gavin King (oneovthafew)
Date: 2003-02-20 00:44

Message:
Logged In: YES 
user_id=384580

Currently there is no support for multi-column types in the
query language. I agree it would be nice, but it is
nontrivial. Please re-submit this as a feature request.

I am closing this bug report, because is is expected
behaviour, not a mistake.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=428708&aid=688743&group_id=40712


-------------------------------------------------------
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


Reply via email to