Bug 104990 - Can't use a path to a link attribute with DataQuery#addOrder(String order)
Can't use a path to a link attribute with DataQuery#addOrder(String order)
Status: CLOSED WONTFIX
Product: Red Hat Web Application Framework
Classification: Retired
Component: persistence (Show other bugs)
nightly
All Linux
medium Severity medium
: ---
: ---
Assigned To: Archit Shah
Jon Orris
:
Depends On:
Blocks: 108447
  Show dependency treegraph
 
Reported: 2003-09-24 09:39 EDT by Daniel Berrange
Modified: 2007-04-18 12:57 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-11-14 15:23:53 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Daniel Berrange 2003-09-24 09:39:17 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.2.9 (X11; Linux i686; U;) Gecko/20030314

Description of problem:
It does not appear to be possible to specifiy a path to a link attribute for the
addOrder(String) method of DataQuery. Consider the following example (against
the Troika categorization object model):

     Category theCategory = new Category(new OID(Category.BASE_DATA_OBJECT_TYPE,
new BigDecimal(531)));
     DataCollection events =
SessionManager.getSession().retrieve("com.arsdigita.cms.contenttypes.Event");
     events.addEqualsFilter("parent.categories.id", theCategory.getID());
     events.addEqualsFilter("language", "en");
     events.addOrder("parent.categories.link.sortKey");

while (events.next()) {
    DataObject o = events.getDataObject();
    System.err.println(o.getOID());
}

This generates an exception:

com.arsdigita.persistence.PersistenceException:  (root cause:
com.redhat.persistence.engine.rdbms.QGen$5: unknown value in expression:
parent.categories.link.sortKey
query signature: com.arsdigita.cms.contenttypes.Event(id, objectType,
displayName, defaultDomainClass, isDeleted, version, name, language, ancestors,
title, launchDate, startDate, endDate, startTime, endTime, eventDate, location,
lead, mainContributor, eventType, mapLink, cost))
	at
com.arsdigita.persistence.PersistenceException.newInstance(PersistenceException.java:137)
	at
com.arsdigita.persistence.PersistenceException.newInstance(PersistenceException.java:109)
	at com.arsdigita.persistence.DataQueryImpl.next(DataQueryImpl.java:458)


Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Write a query similar to above code fragment
2. Try to run it
    

Additional info:
Comment 1 Daniel Berrange 2003-09-24 09:45:32 EDT
Opps, should have pasted the root cause stack trace:

Root cause: 
com.redhat.persistence.engine.rdbms.QGen$5: unknown value in expression:
parent.categories.link.sortKey
query signature: com.arsdigita.cms.contenttypes.Event(id, objectType,
displayName, defaultDomainClass, isDeleted, version, name, language, ancestors,
title, launchDate, startDate, endDate, startTime, endTime, eventDate, location,
lead, mainContributor, eventType, mapLink, cost)
	at com.redhat.persistence.engine.rdbms.QGen$4.map(QGen.java:660)
	at com.redhat.persistence.common.SQLParser.identifier(SQLParser.java(Compiled
Code))
	at
com.redhat.persistence.common.SQLParser.unstructuredElementNoComma(SQLParser.java(Compiled
Code))
	at
com.redhat.persistence.common.SQLParser.unstructuredElement(SQLParser.java(Compiled
Code))
	at com.redhat.persistence.common.SQLParser.sql(SQLParser.java:229)
	at com.redhat.persistence.engine.rdbms.QGen$2.onPassthrough(QGen.java:666)
	at com.redhat.persistence.Expression$Passthrough.dispatch(Expression.java:95)
	at com.redhat.persistence.engine.rdbms.QGen.generate(QGen.java(Inlined Compiled
Code))
	at com.redhat.persistence.engine.rdbms.QGen.generate(QGen.java(Compiled Code))
	at com.redhat.persistence.engine.rdbms.RDBMSEngine.execute(RDBMSEngine.java:231)
	at com.redhat.persistence.engine.rdbms.RDBMSEngine.execute(RDBMSEngine.java:223)
	at com.redhat.persistence.Cursor.execute(Cursor.java:125)
	at com.redhat.persistence.Cursor.next(Cursor.java:109)
	at com.arsdigita.persistence.DataQueryImpl.next(DataQueryImpl.java:456)
Comment 2 Archit Shah 2003-11-26 17:28:09 EST
this should work now. The test of this functionality is
DynamicLinkAttributeTest#deepLink

Note You need to log in before you can comment on or make changes to this bug.