com.agimatec.sql
Class AliasDictionary

java.lang.Object
  extended by com.agimatec.sql.AliasDictionary

public class AliasDictionary
extends java.lang.Object

Internal - This type is part of a SQLWriter and used to create SQL aliases for SQL table names during the generation of an SQL statement.


Field Summary
static java.lang.String ALIAS_RESERVATION
          if table is named @, the alias will not be printed
 
Constructor Summary
AliasDictionary()
          AliasDictionary constructor comment.
 
Method Summary
 void appendAliasListTo(java.io.Writer stream)
          Generate the TABLENAME alias, ... list onto the given stream.
 void clear()
           
 java.lang.String findAlias(java.lang.String tableName)
          return the first alias for the given table
 java.lang.String getHiddenAlias()
           
 java.lang.String removeAlias(java.lang.String alias)
          remove the alias for the table with the given alias.
 void setAlias(java.lang.String tableName, java.lang.String alias)
          set the alias for the given table
 void setAlias(java.lang.String aTableName, java.lang.String aALias, java.lang.String aDBLink)
           
 void setHiddenAlias(java.lang.String ha)
           
 int size()
           
 java.lang.String toString()
          return a string representation (no special format garanteed)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ALIAS_RESERVATION

public static final java.lang.String ALIAS_RESERVATION
if table is named @, the alias will not be printed

See Also:
Constant Field Values
Constructor Detail

AliasDictionary

public AliasDictionary()
AliasDictionary constructor comment.

Method Detail

setHiddenAlias

public void setHiddenAlias(java.lang.String ha)
Parameters:
ha -

getHiddenAlias

public java.lang.String getHiddenAlias()

clear

public void clear()

appendAliasListTo

public void appendAliasListTo(java.io.Writer stream)
                       throws java.io.IOException
Generate the TABLENAME alias, ... list onto the given stream.

Parameters:
stream -
Throws:
java.io.IOException

size

public int size()

findAlias

public java.lang.String findAlias(java.lang.String tableName)
return the first alias for the given table


removeAlias

public java.lang.String removeAlias(java.lang.String alias)
remove the alias for the table with the given alias. return the table for the removed alias, or null if none was found.

Parameters:
alias - - the alias (unique) to remove

setAlias

public void setAlias(java.lang.String tableName,
                     java.lang.String alias)
set the alias for the given table


setAlias

public void setAlias(java.lang.String aTableName,
                     java.lang.String aALias,
                     java.lang.String aDBLink)

toString

public java.lang.String toString()
return a string representation (no special format garanteed)

Overrides:
toString in class java.lang.Object


Copyright © 2008-2012. All Rights Reserved.