|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.mathema.pride.util.CreateTableTemplate
public class CreateTableTemplate
Field Summary | |
---|---|
protected java.lang.String |
baseClassName
|
static java.lang.String |
BEAN
|
protected java.lang.ClassLoader |
classLoader
|
protected java.lang.String |
className
|
protected java.lang.String |
dbDriver
|
protected java.lang.String |
dbName
|
protected java.lang.String |
generationType
|
static java.lang.String |
HYBRID
|
protected java.lang.String |
passwd
|
protected java.lang.String[] |
tableNames
|
protected java.lang.String |
user
|
Constructor Summary | |
---|---|
CreateTableTemplate(java.lang.String dbDriver,
java.lang.String dbName,
java.lang.String user,
java.lang.String passwd,
java.lang.String[] tableNames,
java.lang.String className,
java.lang.String generationType,
java.lang.String baseClassName)
|
|
CreateTableTemplate(java.lang.String dbDriver,
java.lang.String dbName,
java.lang.String user,
java.lang.String passwd,
java.lang.String[] tableNames,
java.lang.String className,
java.lang.String generationType,
java.lang.String baseClassName,
java.lang.ClassLoader classLoader)
|
Method Summary | |
---|---|
java.lang.String |
create()
Creates the entity type by successivly calling the write... functions |
java.lang.String |
extractBeanClass(java.lang.String className)
Retrieve the value type mapped by a specified class. |
java.util.Set |
extractMappedFields(java.lang.String className)
Retrieve the fields being mapped by a specified class. |
RecordDescriptor |
extractRecordDescriptor(java.lang.String className)
|
protected java.util.HashMap |
getAllTableColums(TableDescription[] desc)
Method to Extract all TableColumns from the TableDescriptions |
protected java.lang.String |
getBaseClassName(java.lang.String baseClassName,
java.lang.String generationType)
Determine the base class for the class to generate. |
protected java.lang.String |
getClassName(java.lang.String className)
|
java.sql.Connection |
getDBConnection()
Opens up a database connection accoring to the specified database driver, database name, user, and password |
protected java.lang.String |
getPackage(java.lang.String className)
|
TableDescription[] |
getTableDescription(java.sql.Connection con)
Generates a table description |
protected java.lang.String |
getTableIdType(TableDescription tabCols)
|
protected java.lang.String |
getTableName(java.lang.String[] tables)
|
static void |
main(java.lang.String[] args)
put your documentation comment here |
void |
writeAttributes(TableDescription[] desc,
java.lang.String className,
java.lang.String baseClassName,
java.lang.String generationType,
java.lang.StringBuffer buffer)
Prints the data members to standard out |
void |
writeAuthor(TableDescription[] desc,
java.lang.String className,
java.lang.String baseClassName,
java.lang.String generationType,
java.lang.StringBuffer buffer)
Prints the author tag to standard out, using the current database user and database name as an identificatio |
void |
writeClone(TableDescription[] desc,
java.lang.String className,
java.lang.String baseClassName,
java.lang.String generationType,
java.lang.StringBuffer buffer)
|
void |
writeEntityReference(TableDescription[] desc,
java.lang.String className,
java.lang.String baseClassName,
java.lang.String generationType,
java.lang.StringBuffer buffer)
|
void |
writeFooter(TableDescription[] desc,
java.lang.String className,
java.lang.String baseClassName,
java.lang.String generationType,
java.lang.StringBuffer buffer)
Prints the footer to standard out, i.e. a reconstructor, a default constructor, a toString method, a clone method, and the closing bracket |
void |
writeGetMethods(TableDescription[] desc,
java.lang.String className,
java.lang.String baseClassName,
java.lang.String generationType,
java.lang.StringBuffer buffer)
Prints the geter methods for all members to standard out |
void |
writeHeader(TableDescription[] desc,
java.lang.String className,
java.lang.String baseClassName,
java.lang.String generationType,
java.lang.StringBuffer buffer)
Prints the class header to standard out |
void |
writePackage(TableDescription[] desc,
java.lang.String className,
java.lang.String baseClassName,
java.lang.String generationType,
java.lang.StringBuffer buffer)
Prints the package name to standard out |
void |
writePrimaryKey(TableDescription[] desc,
java.lang.String className,
java.lang.String baseClassName,
java.lang.String generationType,
java.lang.StringBuffer buffer)
Prints the primary key definition and its access function to standard out |
void |
writeReconstructor(TableDescription desc,
java.lang.String className,
java.lang.String baseClassName,
java.lang.StringBuffer buffer)
Prints a reconstructor to restore an existing records from its primary key fields |
void |
writeRecordDescriptor(TableDescription[] desc,
java.lang.String className,
java.lang.String baseClassName,
java.lang.String generationType,
java.lang.StringBuffer buffer)
Prints the record descriptor and its access function to standard out |
void |
writeSetMethods(TableDescription[] desc,
java.lang.String className,
java.lang.String baseClassName,
java.lang.String generationType,
java.lang.StringBuffer buffer)
Prints the seter methods for all members to standard out |
void |
writeToString(TableDescription[] desc,
java.lang.String className,
java.lang.String generationType,
java.lang.StringBuffer buffer)
|
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 HYBRID
public static final java.lang.String BEAN
protected java.lang.String dbDriver
protected java.lang.String dbName
protected java.lang.String user
protected java.lang.String passwd
protected java.lang.String className
protected java.lang.String baseClassName
protected java.lang.String generationType
protected java.lang.String[] tableNames
protected java.lang.ClassLoader classLoader
Constructor Detail |
---|
public CreateTableTemplate(java.lang.String dbDriver, java.lang.String dbName, java.lang.String user, java.lang.String passwd, java.lang.String[] tableNames, java.lang.String className, java.lang.String generationType, java.lang.String baseClassName) throws java.sql.SQLException
java.sql.SQLException
public CreateTableTemplate(java.lang.String dbDriver, java.lang.String dbName, java.lang.String user, java.lang.String passwd, java.lang.String[] tableNames, java.lang.String className, java.lang.String generationType, java.lang.String baseClassName, java.lang.ClassLoader classLoader) throws java.sql.SQLException
java.sql.SQLException
Method Detail |
---|
public RecordDescriptor extractRecordDescriptor(java.lang.String className) throws java.sql.SQLException
java.sql.SQLException
public java.util.Set extractMappedFields(java.lang.String className) throws java.sql.SQLException
RecordDescriptor
field "red"
which the field names can be retrieved from by
RecordDescriptor.getFieldNames(java.lang.String[])
. If you override the
template method writeRecordDescriptor(de.mathema.pride.util.TableDescription[], java.lang.String, java.lang.String, java.lang.String, java.lang.StringBuffer)
to create
record descriptor definitions differently, make sure to also
adapt this function accordingly.
className
- The name of the class to retrieve the mapped fields from
java.sql.SQLException
public java.lang.String extractBeanClass(java.lang.String className) throws java.sql.SQLException
RecordDescriptor
field "red"
which the value type name can be retrieved from by
RecordDescriptor.getObjectType()
.
className
- The name of the class to retrieve the value type from
java.sql.SQLException
public java.lang.String create() throws java.sql.SQLException
java.sql.SQLException
public java.sql.Connection getDBConnection()
public TableDescription[] getTableDescription(java.sql.Connection con) throws java.sql.SQLException
java.sql.SQLException
public void writePackage(TableDescription[] desc, java.lang.String className, java.lang.String baseClassName, java.lang.String generationType, java.lang.StringBuffer buffer)
public void writeAuthor(TableDescription[] desc, java.lang.String className, java.lang.String baseClassName, java.lang.String generationType, java.lang.StringBuffer buffer)
protected java.lang.String getBaseClassName(java.lang.String baseClassName, java.lang.String generationType) throws java.sql.SQLException
MappedObject
,
for adapters it is ObjectAdapter
and for beans
it is nothing. If a base class is passed, it is takes as is. In case of
bean generation, the base class is assumed to specify the base adapter
class and the baes bean class is extracted by reflection.
java.sql.SQLException
public void writeHeader(TableDescription[] desc, java.lang.String className, java.lang.String baseClassName, java.lang.String generationType, java.lang.StringBuffer buffer) throws java.sql.SQLException
java.sql.SQLException
public void writeRecordDescriptor(TableDescription[] desc, java.lang.String className, java.lang.String baseClassName, java.lang.String generationType, java.lang.StringBuffer buffer) throws java.sql.SQLException
java.sql.SQLException
public void writeEntityReference(TableDescription[] desc, java.lang.String className, java.lang.String baseClassName, java.lang.String generationType, java.lang.StringBuffer buffer)
public void writePrimaryKey(TableDescription[] desc, java.lang.String className, java.lang.String baseClassName, java.lang.String generationType, java.lang.StringBuffer buffer)
public void writeAttributes(TableDescription[] desc, java.lang.String className, java.lang.String baseClassName, java.lang.String generationType, java.lang.StringBuffer buffer) throws java.sql.SQLException
java.sql.SQLException
public void writeGetMethods(TableDescription[] desc, java.lang.String className, java.lang.String baseClassName, java.lang.String generationType, java.lang.StringBuffer buffer) throws java.sql.SQLException
java.sql.SQLException
public void writeSetMethods(TableDescription[] desc, java.lang.String className, java.lang.String baseClassName, java.lang.String generationType, java.lang.StringBuffer buffer) throws java.sql.SQLException
java.sql.SQLException
public void writeToString(TableDescription[] desc, java.lang.String className, java.lang.String generationType, java.lang.StringBuffer buffer)
public void writeClone(TableDescription[] desc, java.lang.String className, java.lang.String baseClassName, java.lang.String generationType, java.lang.StringBuffer buffer)
public void writeReconstructor(TableDescription desc, java.lang.String className, java.lang.String baseClassName, java.lang.StringBuffer buffer)
public void writeFooter(TableDescription[] desc, java.lang.String className, java.lang.String baseClassName, java.lang.String generationType, java.lang.StringBuffer buffer)
protected java.lang.String getTableIdType(TableDescription tabCols)
Tabellenbeschreibung
-
protected java.lang.String getPackage(java.lang.String className)
protected java.lang.String getClassName(java.lang.String className)
protected java.lang.String getTableName(java.lang.String[] tables)
protected java.util.HashMap getAllTableColums(TableDescription[] desc)
public static void main(java.lang.String[] args) throws java.sql.SQLException
args
-
java.sql.SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |