org.mmbase.storage.search
Class BridgeClusterQueries

java.lang.Object
  extended by org.mmbase.storage.search.ClusterQueries
      extended by org.mmbase.storage.search.BridgeClusterQueries

public class BridgeClusterQueries
extends ClusterQueries

Since:
MMBase-2.0

Constructor Summary
BridgeClusterQueries(QueryContext.Bridge qc)
           
 
Method Summary
protected  String getBuilder(int nodeNumber)
           
protected  String getBuilder(String tableAlias, Map<String,Integer> roles)
          Gets builder corresponding to the specified table alias.
protected  int getBuilderNumber(String nodeManager)
           
protected  StepField getField(String fieldName, SearchQuery query)
           
protected  Field getNodeField(String name)
           
protected  int getNumberForAlias(String alias)
           
protected  String getParentBuilder(String builder)
           
 QueryContext getQueryContext()
           
 String getTrueTableName(String table)
          Returns the name part of a tablename, and convert it to a buidler name.
protected  boolean isRelation(String builder)
           
protected  boolean optimizeRelationStep(RelationStep rs, int sourceType, int destType, int role, int searchDir)
           
protected  void setConstraint(BasicSearchQuery query, String where)
           
 
Methods inherited from class org.mmbase.storage.search.ClusterQueries
addFields, addRelationDirections, addSortOrders, addSteps, getBuilderNameFromField, getField, getFieldNameFromField, getMultiLevelSearchQuery, getNodesStep, getSearchDirString, getTableName, getUniqueTableAlias
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BridgeClusterQueries

public BridgeClusterQueries(QueryContext.Bridge qc)
Method Detail

getQueryContext

public QueryContext getQueryContext()
Specified by:
getQueryContext in class ClusterQueries

getNumberForAlias

protected int getNumberForAlias(String alias)
Specified by:
getNumberForAlias in class ClusterQueries

isRelation

protected boolean isRelation(String builder)
Specified by:
isRelation in class ClusterQueries

getBuilder

protected String getBuilder(int nodeNumber)
Specified by:
getBuilder in class ClusterQueries

getBuilderNumber

protected int getBuilderNumber(String nodeManager)
Specified by:
getBuilderNumber in class ClusterQueries

getParentBuilder

protected String getParentBuilder(String builder)
Specified by:
getParentBuilder in class ClusterQueries

getField

protected StepField getField(String fieldName,
                             SearchQuery query)
Specified by:
getField in class ClusterQueries

getTrueTableName

public String getTrueTableName(String table)
Description copied from class: ClusterQueries
Returns the name part of a tablename, and convert it to a buidler name. This will catch specifying a rolename in stead of a builder name when using relations.

Specified by:
getTrueTableName in class ClusterQueries
Parameters:
table - name of the original table
Returns:
A String containing the table name

optimizeRelationStep

protected boolean optimizeRelationStep(RelationStep rs,
                                       int sourceType,
                                       int destType,
                                       int role,
                                       int searchDir)
Specified by:
optimizeRelationStep in class ClusterQueries

getBuilder

protected String getBuilder(String tableAlias,
                            Map<String,Integer> roles)
Description copied from class: ClusterQueries
Gets builder corresponding to the specified table alias. This amounts to removing the optionally appended digit from the table alias, and interpreting the result as either a tablename or a relation role.

Specified by:
getBuilder in class ClusterQueries
Parameters:
tableAlias - The table alias. Must be tablename or relation role, optionally appended with a digit, e.g. images, images3, related and related4.
roles - Map of tablenames mapped to Integer values, representing the nodenumber of a corresponing RelDef node. This method adds entries for table aliases that specify a role, e.g. "related" or "related2".
Returns:
The builder.

getNodeField

protected Field getNodeField(String name)
Specified by:
getNodeField in class ClusterQueries

setConstraint

protected void setConstraint(BasicSearchQuery query,
                             String where)
Specified by:
setConstraint in class ClusterQueries


MMBase 2.0-SNAPSHOT - null