This discussion is archived
5 Replies Latest reply: Nov 7, 2012 10:57 AM by karthik chopperla RSS

RqlStatement for querying auxiliary table

959025 Newbie
Currently Being Moderated
I need to query a auxiliary table i have created for dcs_product. But im unable to do so.

Auxiliary table created as below:

atg/commerce/catalog/ProductCatalog.xml

<?xml version="1.0" encoding="UTF-8"?>
<gsa-template>
     <item-descriptor name="product" xml-combine="append">
          <table name="my_dcs_product" type="auxilary"
               id-column-name="product_id">
               <property category-resource="categoryInfo"
                    name="isBlacklisted" column-name="isBlacklisted" data-type="string" default="no"/>
          </table>
     </item-descriptor>
</gsa-template>

RqlStatement:

Repository repository = (Repository)ServletUtil.getCurrentRequest().resolveName("/atg/commerce/catalog/ProductCatalog");
RepositoryView rview = repository.getView("product");
RqlStatement statement = RqlStatement.parseRqlStatement("isBlacklisted = ?0");
Object params[] = new Object[1];
params[0] = new String("yes");
RepositoryItem[] items = statement.executeQuery (rview, params);
RepositoryItem ritem =items[0];


But I am getting an error as:

atg.repository.RepositoryException: No property named "isBlacklisted" could be found in the item descriptor "product".

Can you please help!!!

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points