|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.javagen.agile.db.DbLoader
public class DbLoader
Create DB model tree from JDBC metadata from provided DataSource.
The scope of the model tree can be limited by specifying a list of
includeTableNames and/or excludeTableNames, otherwise
all table schemas are loaded.
| Field Summary | |
|---|---|
protected DataSource |
dataSource
|
protected Set<String> |
excludeTableNames
|
protected List<String> |
includeTableNames
|
protected boolean |
namesToUpperCase
|
protected Model |
parentModel
|
| Constructor Summary | |
|---|---|
DbLoader()
|
|
| Method Summary | |
|---|---|
Model |
gen(Model input)
Create DB model tree from JDBC metadata from provided DataSource. |
DataSource |
getDataSource()
|
Set<String> |
getExcludeTableNames()
|
List<String> |
getIncludeTableNames()
|
Model |
getParentModel()
|
boolean |
isNamesToUpperCase()
|
void |
load(Database database)
Load tables into Database instance using supplied DataSource. |
void |
loadImportedKeys(DatabaseMetaData dbMeta,
Database database,
List<String> tableList)
Wire up foreign key relationships |
List<String> |
loadTableList(DatabaseMetaData dbMeta,
Database database)
Create list of all table names from DatabaseMetaData. |
void |
loadTables(Connection dbconn,
DatabaseMetaData dbMeta,
Database database,
List<String> tableList)
Populate column data for this table obtained from DatabaseMetaData.getColumns() ResultSet. |
void |
setDataSource(DataSource dataSource)
|
void |
setExcludeTableNames(Set<String> excludeTableNames)
|
void |
setExcludeTables(String delineatedExcludeTables)
White-space/comma delineated list of table names to exclude from the transformation process. |
void |
setIncludeTableNames(List<String> tableNames)
|
void |
setIncludeTables(String delineatedIncludeTables)
White-space/comma delineated list of table names to include in the transformation process. |
void |
setNamesToUpperCase(boolean namesToUpperCase)
|
void |
setParentModel(Model baseModel)
|
void |
verifyTableList(DatabaseMetaData dbMeta,
Database database,
List<String> tableList)
Verify existence of provided table list. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected DataSource dataSource
protected List<String> includeTableNames
protected Set<String> excludeTableNames
protected Model parentModel
protected boolean namesToUpperCase
| Constructor Detail |
|---|
public DbLoader()
| Method Detail |
|---|
public Model gen(Model input)
gen in interface Generatorinput - can be one of three possibilities:
public void load(Database database)
throws SQLException
SQLException
public List<String> loadTableList(DatabaseMetaData dbMeta,
Database database)
throws SQLException
SQLException
public void verifyTableList(DatabaseMetaData dbMeta,
Database database,
List<String> tableList)
throws SQLException
SQLException
public void loadTables(Connection dbconn,
DatabaseMetaData dbMeta,
Database database,
List<String> tableList)
public void loadImportedKeys(DatabaseMetaData dbMeta,
Database database,
List<String> tableList)
throws SQLException
dbMeta - DatabaseMetaData instancedatabase - root model node of DB treetableSet - Mechinism for mapping subset of tables - FKs to tables not in this list are just treated like data columns.
SQLExceptionpublic List<String> getIncludeTableNames()
public void setIncludeTableNames(List<String> tableNames)
public DataSource getDataSource()
public void setDataSource(DataSource dataSource)
public Model getParentModel()
public void setParentModel(Model baseModel)
public boolean isNamesToUpperCase()
public void setNamesToUpperCase(boolean namesToUpperCase)
public Set<String> getExcludeTableNames()
public void setExcludeTableNames(Set<String> excludeTableNames)
public void setIncludeTables(String delineatedIncludeTables)
public void setExcludeTables(String delineatedExcludeTables)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||