deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.io.datastore.sql
Class TableAliasGenerator

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

public class TableAliasGenerator
extends 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(String prefix)
          Creates a new TableAliasGenerator instance that uses the given prefix for generated table aliases.
 
Method Summary
 String generateUniqueAlias()
          Returns a unique alias.
 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(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 String generateUniqueAlias()
Returns a unique alias.

Returns:
a unique alias

generateUniqueAliases

public 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.3 (2010/04/09 10:10 build-4-official)

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