net.sourceforge.addam.ddlgen.generic
Class VelocityGenerator

java.lang.Object
  extended by net.sourceforge.addam.ddlgen.generic.VelocityGenerator
All Implemented Interfaces:
Generator
Direct Known Subclasses:
ForeignKeyGenerator, InsertGenerator, TableGenerator

public abstract class VelocityGenerator
extends Object
implements Generator

ENTER A DESCRIPTION HERE

Since:
Oct 9, 2005
Author:
TIM3

Constructor Summary
VelocityGenerator()
           
 
Method Summary
 void generate(String catalog, String schema, String object, String vendor, Connection connection, DatabaseMetaData metadata, BufferedWriter writer)
          writes a SQL/DDL scripts for the given object to the writer
protected abstract  org.apache.velocity.VelocityContext getContext(String catalog, String schema, String object, Connection connection, DatabaseMetaData metadata)
           
 List<String> getObjects(String catalog, String schema, Filter filter, Connection connection, DatabaseMetaData metadata)
          Return the list of objects for the given catalog and schema.
protected  org.apache.velocity.Template getTemplate(DatabaseMetaData metadata, String vendor)
           
protected  String getTemplateName(String vendor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VelocityGenerator

public VelocityGenerator()
Method Detail

getObjects

public List<String> getObjects(String catalog,
                               String schema,
                               Filter filter,
                               Connection connection,
                               DatabaseMetaData metadata)
                        throws Exception
Description copied from interface: Generator
Return the list of objects for the given catalog and schema.

Specified by:
getObjects in interface Generator
Parameters:
catalog - the database object's catalog
schema - the database object's schema
filter - the definition of the generator (used for included/excluded objects)
connection - the database connection
metadata - database metadata for the connection
Returns:
Throws:
Exception

generate

public void generate(String catalog,
                     String schema,
                     String object,
                     String vendor,
                     Connection connection,
                     DatabaseMetaData metadata,
                     BufferedWriter writer)
              throws Exception
Description copied from interface: Generator
writes a SQL/DDL scripts for the given object to the writer

Specified by:
generate in interface Generator
Parameters:
catalog - the database object's catalog
schema - the database object's schema
object - the database object to generate
connection - the database connection
metadata - database metadata for the connection
writer - what to write the generated SQL/DDL to
Throws:
Exception

getContext

protected abstract org.apache.velocity.VelocityContext getContext(String catalog,
                                                                  String schema,
                                                                  String object,
                                                                  Connection connection,
                                                                  DatabaseMetaData metadata)
                                                           throws Exception
Throws:
Exception

getTemplate

protected org.apache.velocity.Template getTemplate(DatabaseMetaData metadata,
                                                   String vendor)
                                            throws Exception
Throws:
Exception

getTemplateName

protected String getTemplateName(String vendor)


Copyright © 2005-2006 ADDAM Project Team. All Rights Reserved.