org.caleigo.core.service
Class SQLSelectCommand

java.lang.Object
  extended byorg.caleigo.core.service.SQLSelectCommand

public class SQLSelectCommand
extends java.lang.Object

Instances of this class is used to get as few uniq aliases as possible in a SQL SELECT statement's SELECT-, FROM-, JOIN- and WHERE- expressions/clauses.

Author:
Niklas Norberg

Constructor Summary
SQLSelectCommand()
           
 
Method Summary
protected  void append(char c)
           
protected  void append(java.lang.String str)
           
protected  void collectAllEntityRelationPathsAndMakeUniqAliases(DataQuery.ExternalQualifier[] xTernalQualifiers)
          This method collects paths and alias lists in an external qualifer and make uniq alias.
protected  void collectAllEntityRelationPathsAndMakeUniqAliases(ICompositeEntityDescriptor.ICompositeFieldGroup rootFieldGroup)
          This method collects all entity relation path in a field group tree.
protected  java.lang.String[] getAliasArray(IEntityRelationPath entityRelationPath)
          Get uniq aliases for a path.
protected  java.lang.String getRootAlias()
           
protected  boolean isAliasDeclared(java.lang.String alias)
           
protected  void markAliasAsDeclared(java.lang.String declaredAlias)
           
protected  void setRootAlias(java.lang.String rootAlias)
           
protected  void shortenCommandWith(int shortenThisMuch)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SQLSelectCommand

public SQLSelectCommand()
Method Detail

getRootAlias

protected java.lang.String getRootAlias()

toString

public java.lang.String toString()

isAliasDeclared

protected boolean isAliasDeclared(java.lang.String alias)

getAliasArray

protected java.lang.String[] getAliasArray(IEntityRelationPath entityRelationPath)
Get uniq aliases for a path.

Parameters:
entityRelationPath - a path to get uniq aliases for.
Returns:
a String-array containing uniq aliases for the path.

append

protected void append(java.lang.String str)

append

protected void append(char c)

shortenCommandWith

protected void shortenCommandWith(int shortenThisMuch)

setRootAlias

protected void setRootAlias(java.lang.String rootAlias)

markAliasAsDeclared

protected void markAliasAsDeclared(java.lang.String declaredAlias)

collectAllEntityRelationPathsAndMakeUniqAliases

protected void collectAllEntityRelationPathsAndMakeUniqAliases(ICompositeEntityDescriptor.ICompositeFieldGroup rootFieldGroup)
This method collects all entity relation path in a field group tree. String-arrays are created and paired with every path. Lastly every path are added to the internal member mEntityRelationPathAliasTree and uniq alias are made for slave entities.

Parameters:
rootFieldGroup - the root in the field group tree.

collectAllEntityRelationPathsAndMakeUniqAliases

protected void collectAllEntityRelationPathsAndMakeUniqAliases(DataQuery.ExternalQualifier[] xTernalQualifiers)
This method collects paths and alias lists in an external qualifer and make uniq alias.

Parameters:
xTernalQualifiers - the external qualifer to collect paths and alias from.


Copyright © 2005 Caleigo. All Rights Reserved.