5 Replies Latest reply: Nov 7, 2012 12:57 PM by karthik chopperla RSS

    RqlStatement for querying auxiliary table

    959025
      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!!!