SAP NetWeaver '04

com.sapportals.wcm.service.relation
Interface IRelationQueryBuilder

[contained in: com.sap.netweaver.bc.rf.service.par - bc.rf.global.service.relation_api.jar]
public interface IRelationQueryBuilder

A query builder wich creates IQueryExpressions to be used with the relation service.
A IRelationQueryBuilder constructs IRelationQuery s, which can be executed by IRelationService.getRelations(com.sapportals.wcm.repository.IResourceContext, IRelationQuery)/ Constructing a query is done like

 query = service.getQueryBuilder();
 memberOfType = service.getRelationType(context, "collaboration", "member-of");
 attributeName = new PropertyName("office", "location");
 queryExpression = query.relation(memberOfType).and(query.source(attributeName).equals("Walldorf"));
 


Method Summary
 IRelationQuery all()
          Return query expression to select all relations.
 IRelationQuery all(java.lang.String namespace)
          Return query expression to selects all the relations for those relation types which match the given namespace.
 IRelationQueryOrder orderByProperty(IPropertyName propertyName)
          Get an order expression which sorts by the value of a given property.
 IRelationQueryOrder orderBySource()
          Get an order expression which sorts by source id.
 IRelationQueryOrder orderByTarget()
          Get an order expression which sorts by target id.
 IRelationPropertyQuery property(IPropertyName propertyName)
          Return an expression for the given relation property's value (select only those relations with the given relation property matching the given expression).
 IRelationQuery relationType(IRelationType type)
          Return query expression to select the relations of the given relation type.
 IRelationOperandQuery source()
          Return an expression for the source operand's id (select only those relations with source id matching the given expression).
 IRelationOperandQuery sourceOrTarget()
          Return an expression for the source operand's or target operand's id (select only those relations with source id or target id matching the given expression).
 IRelationOperandQuery target()
          Return an expression for the target operand's id (select only those relations with target id matching the given expression).
 

Method Detail

all

public IRelationQuery all()
Return query expression to select all relations.
Returns:
a IRelationQuery to select any relations.

all

public IRelationQuery all(java.lang.String namespace)
Return query expression to selects all the relations for those relation types which match the given namespace.
Parameters:
namespace - a String with the namespace of the relation types. if null , all relation namespaces are selected.
Returns:
a IRelationQuery to select the relations for the relation types within the given namespace.

relationType

public IRelationQuery relationType(IRelationType type)
Return query expression to select the relations of the given relation type.
Parameters:
type - the IRelationType to use as selection criteria. if null , all types are selected.
Returns:
a IRelationQuery to select the relations for the given relation type.

source

public IRelationOperandQuery source()
Return an expression for the source operand's id (select only those relations with source id matching the given expression).
Returns:
a IRelationOperandQuery with the 'source' expression.

target

public IRelationOperandQuery target()
Return an expression for the target operand's id (select only those relations with target id matching the given expression).
Returns:
a IRelationOperandQuery with the 'target' expression.

sourceOrTarget

public IRelationOperandQuery sourceOrTarget()
Return an expression for the source operand's or target operand's id (select only those relations with source id or target id matching the given expression). This is just a shortcut, allowing to replace query.source().equal(value ).or(query.target().equal(value )) with query.sourceOrTarget().equal(value ) .
Returns:
a IRelationOperandQuery with the 'target' expression.

property

public IRelationPropertyQuery property(IPropertyName propertyName)
Return an expression for the given relation property's value (select only those relations with the given relation property matching the given expression).
Parameters:
propertyName - the IPropertyName<(/code> of the property to use for selection.
Returns:
a IRelationPropertyQuery with the 'relation-property' expression.

orderBySource

public IRelationQueryOrder orderBySource()
Get an order expression which sorts by source id.
Returns:
a IRelationQueryOrder for the source id.

orderByTarget

public IRelationQueryOrder orderByTarget()
Get an order expression which sorts by target id.
Returns:
a IRelationQueryOrder for the target id.

orderByProperty

public IRelationQueryOrder orderByProperty(IPropertyName propertyName)
Get an order expression which sorts by the value of a given property.
Parameters:
propertyName - the IPropertyName<(/code> of the property to use for ordering.
Returns:
a IRelationQueryOrder for the given property.

SAP NetWeaver '04

Copyright © 2004 by SAP AG. All Rights Reserved.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.