This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 104889 - DataQuery#addPath() doesn't work if the association has link attributes
DataQuery#addPath() doesn't work if the association has link attributes
Status: CLOSED RAWHIDE
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:
  Show dependency treegraph
 
Reported: 2003-09-23 05:53 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: 2006-09-02 13:43:11 EDT
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-23 05:53:25 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.2.9 (X11; Linux i686; U;) Gecko/20030314

Description of problem:
Attempting to add a path that crosses an association with link attributes does
not work.

 For example, my model looks like:

object type AtoZCategoryProvider extends AtoZProvider {
    Boolean isCompound = atoz_cat_provider.is_compound BIT;

    reference key (atoz_cat_provider.provider_id);
}

association {
  AtoZCategoryProvider[0..n] atozProvider = join cat_categories.category_id
                                              to atoz_cat_provider_map.category_id,
                                            join atoz_cat_provider_map.provider_id
                                              to atoz_cat_provider.provider_id;
  Category[0..n] atozEntries = join atoz_cat_provider.provider_id
                                 to atoz_cat_provider_map.provider_id,
                               join atoz_cat_provider_map.category_id
                                 to cat_categories.category_id;
  Boolean[1..1] isVisible = atoz_cat_provider_map.is_visible BIT;
}


For example, if I then do:

  DataCollection c =
SessionManager.getSession().retrieve("com.arsdigita.london.atoz.AtoZCategoryProvider");
  c.addPath("atozEntries.name");
  c.addEqualsFilter("atozEntries.id", catID);
  
  System.err.println("---Entries---");
  while (c.next()) {
    DataObject o = c.getDataObject();
    System.err.println(o);
    System.err.println("Entry: " + c.get("atozEntries.name"));
  }
  System.err.println("---Done---");

then an exception is thrown:

  java.lang.IllegalStateException: no mapping for: atozEntries
        at com.redhat.persistence.engine.rdbms.QGen$1.onStatic(QGen.java:616)
        at com.redhat.persistence.metadata.Static.dispatch(Static.java:40)
        at
com.redhat.persistence.engine.rdbms.QGen.genPathRecursive(QGen.java(Compiled Code))
        at
com.redhat.persistence.engine.rdbms.QGen.genPathRecursive(QGen.java(Compiled Code))
        at com.redhat.persistence.engine.rdbms.QGen.genPath(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)

If I comment out the 'isVisible' link attribute in the association it works as
expected.


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


How reproducible:
Always

Steps to Reproduce:
1. See above code


Additional info:
Comment 1 Daniel Berrange 2003-09-24 09:32:12 EDT
I have further tested this & verified it also affects paths supplied to filters.
For example (with 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");
     while (events.next()) {
        ....
     }


Results in:

java.lang.IllegalStateException: no mapping for: categories
	at com.redhat.persistence.engine.rdbms.QGen$1.onStatic(QGen.java:616)
	at com.redhat.persistence.metadata.Static.dispatch(Static.java:40)
	at com.redhat.persistence.engine.rdbms.QGen.genPathRecursive(QGen.java(Compiled
Code))
	at com.redhat.persistence.engine.rdbms.QGen.genPathRecursive(QGen.java(Compiled
Code))
	at com.redhat.persistence.engine.rdbms.QGen.genPath(QGen.java(Inlined Compiled
Code))
	at com.redhat.persistence.engine.rdbms.QGen.access$500(QGen.java(Compiled Code))
	at com.redhat.persistence.engine.rdbms.QGen$4.map(QGen.java:650)
	at com.redhat.persistence.common.SQLParser.parens(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(Inlined
Compiled Code))
	at
com.redhat.persistence.engine.rdbms.RDBMSEngine.execute(RDBMSEngine.java(Compiled
Code))
	at com.redhat.persistence.Cursor.execute(Cursor.java(Inlined Compiled Code))
	at com.redhat.persistence.Cursor.next(Cursor.java(Compiled Code))
	at com.arsdigita.persistence.DataQueryImpl.next(DataQueryImpl.java(Compiled Code))
Comment 2 Rafael H. Schloming 2003-11-26 21:37:57 EST
There is now a test that verifies that this is fixed on the trunk.
Comment 3 David Lawrence 2006-07-17 23:44:29 EDT
QA_READY has been deprecated in favor of ON_QA. Please use ON_QA in the future.
Moving to ON_QA.
Comment 4 Daniel Berrange 2006-09-02 13:43:11 EDT
Closing old tickets

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