|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectinfo.fingo.db.DBTool
public class DBTool
The simply object-relational mapping tool. This tool is desined to generate entities and collection on the oracle database schema base. Besides support for entities attributes it generates some helper functionality to service database relations. It generates two levels of classes: base classes - overwritten on each generation run, which have all the generated code, and extensions - initialy just empty classes, which shouldn't be overwritten, so here you may pyt all the additional logic you need. The next refactoring should change the generation process to use some external templates instead of direct printing to the result output stream.
BaseEntity,
BaseCollection| Field Summary | |
|---|---|
static java.lang.String |
PROPERTY_BASE_SUFFIX
The configuration propery: the base-level classes name sufix = 'base.suffix' |
static java.lang.String |
PROPERTY_COLLECTION_PACKAGE_NAME
The configuration propery: the name of the package for collections = 'collection.package.name' |
static java.lang.String |
PROPERTY_COLLECTION_SOURCE_FOLDER
The configuration propery: the folder to generate collections = 'collection.source.folder' |
static java.lang.String |
PROPERTY_COLLECTION_SUFFIX
The configuration propery: the collections names suffix = 'collection.suffix' |
static java.lang.String |
PROPERTY_DB_DRIVER
The configuration propery: database driver class name = 'db.driver' |
static java.lang.String |
PROPERTY_DB_PASSWORD
The configuration propery: database driver class name = 'db.driver' |
static java.lang.String |
PROPERTY_DB_URL
The configuration propery: database url class name = 'db.url' |
static java.lang.String |
PROPERTY_DB_USER
The configuration propery: database user class name = 'db.user' |
static java.lang.String |
PROPERTY_ENTITY_PACKAGE_NAME
The configuration propery: the name of the package for entities = 'entity.package.name' |
static java.lang.String |
PROPERTY_ENTITY_SOURCE_FOLDER
The configuration propery: the folder to generate entities = 'entity.source.folder' |
static java.lang.String |
PROPERTY_ENTITY_SUFFIX
The configuration propery: the entities names suffix = 'entity.suffix' |
static java.lang.String |
PROPERTY_REGENERATE_ALL
The configuration propery: IMPORTANT!!! |
static java.lang.String |
PROPERTY_TABLE_NAME_PATTERN
The configuration propery: the pattern for tables to generate entities and collections = 'table.name.pattern' |
static java.lang.String |
PROPERTY_TABLE_PREFIX_CUT
The configuration propery: the count of first characters of entities/collections names to cut = 'table.prefix.cut' |
| Constructor Summary | |
|---|---|
DBTool(java.util.Properties props)
Creates new instance with given configuration. |
|
| Method Summary | |
|---|---|
void |
generate()
Performs the entities and collections generation. |
static void |
main(java.lang.String[] args)
The generation start. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PROPERTY_DB_DRIVER
public static final java.lang.String PROPERTY_DB_URL
public static final java.lang.String PROPERTY_DB_USER
public static final java.lang.String PROPERTY_DB_PASSWORD
public static final java.lang.String PROPERTY_TABLE_NAME_PATTERN
public static final java.lang.String PROPERTY_TABLE_PREFIX_CUT
public static final java.lang.String PROPERTY_ENTITY_SUFFIX
public static final java.lang.String PROPERTY_ENTITY_SOURCE_FOLDER
public static final java.lang.String PROPERTY_ENTITY_PACKAGE_NAME
public static final java.lang.String PROPERTY_COLLECTION_SUFFIX
public static final java.lang.String PROPERTY_COLLECTION_SOURCE_FOLDER
public static final java.lang.String PROPERTY_COLLECTION_PACKAGE_NAME
public static final java.lang.String PROPERTY_BASE_SUFFIX
public static final java.lang.String PROPERTY_REGENERATE_ALL
true all sources,
including your changes in extended level, will be overwritten.
| Constructor Detail |
|---|
public DBTool(java.util.Properties props)
PROPERTY_XXX
constants.
props - the configuration properties| Method Detail |
|---|
public static void main(java.lang.String[] args)
PROPERTY_XXX constants.
args - the parameter of generation process.
public void generate()
throws java.lang.Exception
java.lang.Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||