deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.io.datastore.sql
Class TableAliasGenerator

java.lang.Object
  extended by org.deegree.io.datastore.sql.TableAliasGenerator

public class TableAliasGenerator
extends java.lang.Object

Responsible for the generation of unique table aliases. This is needed in SQL queries in order to built joins that use the same table more than once.

Version:
$Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18 Jun 2009) $
Author:
Markus Schneider , last edited by: $Author: mschneider $

Constructor Summary
TableAliasGenerator()
          Creates a new TableAliasGenerator instance that uses a default prefix for generated table aliases.
TableAliasGenerator(java.lang.String prefix)
          Creates a new TableAliasGenerator instance that uses the given prefix for generated table aliases.
 
Method Summary
 java.lang.String generateUniqueAlias()
          Returns a unique alias.
 java.lang.String[] generateUniqueAliases(int n)
          Returns the specified number of unique aliases.
 void reset()
          Resets the alias sequence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableAliasGenerator

public TableAliasGenerator()
Creates a new TableAliasGenerator instance that uses a default prefix for generated table aliases.


TableAliasGenerator

public TableAliasGenerator(java.lang.String prefix)
Creates a new TableAliasGenerator instance that uses the given prefix for generated table aliases.

Parameters:
prefix - prefix for generated table aliases
Method Detail

generateUniqueAlias

public java.lang.String generateUniqueAlias()
Returns a unique alias.

Returns:
a unique alias

generateUniqueAliases

public java.lang.String[] generateUniqueAliases(int n)
Returns the specified number of unique aliases.

Parameters:
n -
Returns:
the specified number of unique aliases

reset

public void reset()
Resets the alias sequence.


deegree 2.5 (2011/06/29 09:44 build-8-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org