ch.sahits.codegen.model
Class HeadlessBasicModelFactory

java.lang.Object
  extended by ch.sahits.codegen.model.BasicModelFactoryHelper
      extended by ch.sahits.codegen.model.HeadlessBasicModelFactory

public final class HeadlessBasicModelFactory
extends BasicModelFactoryHelper

This Model factory class is a factory for input data models for non Java code. This factory can be used without the UI

Since:
2.1.0
Author:
Andi Hotz, Sahits GmbH

Method Summary
static IDBTable createModelWithDBConnection(java.lang.String dbProduct, java.lang.String host, java.lang.String port, java.lang.String dbName, java.lang.String userName, java.lang.String passWd, java.lang.String tableName, java.lang.String schema, IProgressMonitor monitor)
          Generates a model of a database table.
static IDBTable createModelWithDBInputFile(java.lang.String dbProduct, java.lang.String inputFilePath, IProgressMonitor monitor)
          Generates the model based on the class name and the inputFilePath Data in the wizard provided but not contained in the inputfilePath must be added to the model by the caller
static IGeneratedObject createModelWithoutDB(java.lang.String inputFilePath, IProgressMonitor monitor)
          Generates a model for the class that is not based on a database table
static int getModelGenerationWorkload(int modelBase, java.lang.String inputFilePath, java.lang.String dbProduct)
          Compute the number of work units for the generation of the file
static void setCurrentDBDefinitionPage(IBasicDBDefinitionPageGeneratable secondPage)
           
 
Methods inherited from class ch.sahits.codegen.model.BasicModelFactoryHelper
convert, createModelFromExtension, createModelWithoutDBFromXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setCurrentDBDefinitionPage

public static void setCurrentDBDefinitionPage(IBasicDBDefinitionPageGeneratable secondPage)
Parameters:
secondPage - the page2 to set

createModelWithDBConnection

public static IDBTable createModelWithDBConnection(java.lang.String dbProduct,
                                                   java.lang.String host,
                                                   java.lang.String port,
                                                   java.lang.String dbName,
                                                   java.lang.String userName,
                                                   java.lang.String passWd,
                                                   java.lang.String tableName,
                                                   java.lang.String schema,
                                                   IProgressMonitor monitor)
Generates a model of a database table. The needed information for the table is retrieved over the database connection

Parameters:
dbProduct - database product
host - name of the database
port - number of the database
dbName - name of the database
userName - name of the database user
passWd - password for the user
tableName - name of the database table
monitor - Progress monitor
schema - name
Returns:
BasicDataBaseTable

createModelWithDBInputFile

public static IDBTable createModelWithDBInputFile(java.lang.String dbProduct,
                                                  java.lang.String inputFilePath,
                                                  IProgressMonitor monitor)
                                           throws java.io.FileNotFoundException,
                                                  java.io.IOException
Generates the model based on the class name and the inputFilePath Data in the wizard provided but not contained in the inputfilePath must be added to the model by the caller

Parameters:
dbProduct - name of the database product
inputFilePath - path to the input file the model is based upon
monitor - Progress monitor
Returns:
model of a subtype of IGeneratedJavaDBClass
Throws:
java.io.IOException - File could not be read
java.io.FileNotFoundException - File path incorrect

createModelWithoutDB

public static IGeneratedObject createModelWithoutDB(java.lang.String inputFilePath,
                                                    IProgressMonitor monitor)
Generates a model for the class that is not based on a database table

Parameters:
inputFilePath - path to the input file the model is based upon
monitor - Progress monitor
Returns:
generated model

getModelGenerationWorkload

public static int getModelGenerationWorkload(int modelBase,
                                             java.lang.String inputFilePath,
                                             java.lang.String dbProduct)
Compute the number of work units for the generation of the file

Parameters:
inputFilePath - path to the input file the model is based upon
modelBase - code for the generation
dbProduct - name of the database product my be null if the generation is not done with a database
Returns:
Number of work units for the model generation