Bugs item #688743, was opened at 2003-02-18 08:41 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428708&aid=688743&group_id=40712
Category: None Group: None Status: Open Resolution: None 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 ---------------------------------------------------------------------- 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