Develop > Business logic layer > Work with the data service layer > Create a query
Generate the XPath key using the wcs_xpathkey utility
The XPath key generator command-line utility takes an XPath expression as input and generates an XPath key. This key is used to locate the XPATH_TO_SQL_STATEMENT template in the query template file.
The name of the XPath to SQL template is the same as the key for two-step queries. For single-step queries, it is a combination of the XPath key and the name of the access profile. To generate the XPath key:
Procedure
- Open a command line prompt and navigate to WCDE_INSTALL\bin.
- Run the following command, where MyXPath is your XPath expression:
wcs_xpathkey MyXPathFor example:
wcs_xpathkey /CatalogEntry[(@catalogEntryTypeCode='ProductBean' or @catalogEntryTypeCode='ItemBean') and ParentCatalogGroupIdentifier[ExternalIdentifier[GroupIdentifier='Coffee Table']]]The output from this command would be:
/CatalogEntry[(@catalogEntryTypeCode=) and ParentCatalogGroupIdentifier[ExternalIdentifier[GroupIdentifier=]]]
Related concepts
Related reference
Data service layer naming conventions
WebSphere Commerce extended XPath notation