Understanding > WebSphere Commerce and service-oriented architecture (SOA) > Data service layer > Data service layer query processing > Query template file

Commerce Feature Pack


Graph composer

In the query template file, an optional graph composer Java class can be specified in the ENTITY section within the PROFILE block. This Java class allows you to augment the final graph of physical SDOs. It can perform data aggregation from other sources and can merge multiple graphs of physical SDOs into a single graph if there is more than one associated SQL statement defined in the profile for the base table object.

The graph composer is needed for two-step queries that use multiple association SQL statements. You need to implement your own graph composer only if the result sets of the association SQL statements retrieve identical records from tables other than the base table.

If specified, the graph composer must subclass from the com.ibm.commerce.foundation.server.services.dataaccess.GraphComposer abstract class and implement the abstract composeGraph() method.

For example:

BEGIN_PROFILE 
  name=profileName1

  BEGIN_ENTITY 
    entity_table=CATENTRY 

<!-- must subclass from com.ibm.commerce.foundation.server.services.dataaccess.GraphComposer -->
<!-- used to compose the final graph --> 
<!-- if more than one associated SQL statement defined -->
    className=com.my.GraphComposer

   associated_sql_statement=CatEntryWithDescription
   associated_sql_statement=CatEntryWithProperty
 END_ENTITY
END_PROFILE

Related tasks

Create a query

Create an access profile for an existing XPath expression

Extending a default WebSphere Commerce query

Generating your XPath key using the wcs_xpathkey utility

Related reference

SQL parameters

Query template file tags

Data service layer naming conventions

WebSphere Commerce extended XPath notation

Last updated: 25 November 2009