|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.clazzes.jdbc2xml.schema.SchemaEngine
public abstract class SchemaEngine
An implementation of this class is responsible for creating/modifying a database schema based on table descriptions.
Constructor Summary | |
---|---|
protected |
SchemaEngine()
Default constructor, which sets the default time zone. |
protected |
SchemaEngine(IDialectFactory dialectFactory)
Default constructor, which sets the default time zone. |
Method Summary | |
---|---|
Connection |
getConnection()
|
Dialect |
getDialect()
|
String |
getSchema()
|
TimeZone |
getTimeZone()
|
static ISchemaEngine |
newInstance()
After generating a new SchemaEngine instance you usually have to call setConnection(Connection) in order to set up the database
on which to operate. |
void |
setConnection(Connection connection)
This method initializes the database dialect too, if the the dialect has not been set through ISchemaEngine.setDialect(Dialect)
before. |
void |
setDialect(Dialect dialect)
Normally you need not call this method, because the dialect is usually initialized by ISchemaEngine.setConnection(Connection) . |
void |
setSchema(String schema)
|
void |
setTimeZone(TimeZone timeZone)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.clazzes.jdbc2xml.schema.ISchemaEngine |
---|
addColumn, addForeignKey, addIndex, changeColumn, commit, createForeignKeys, createInsertStatement, createTable, dropColumn, dropForeignKey, dropForeignKeys, dropIndex, dropStaleBackupTables, dropTable, dropTables, fetchTableInfo, fetchTableInfos, getMaxTableNameLength, getTempTableNames, modifyColumn, renameTable, rollback |
Constructor Detail |
---|
protected SchemaEngine()
protected SchemaEngine(IDialectFactory dialectFactory)
Method Detail |
---|
public static ISchemaEngine newInstance()
After generating a new SchemaEngine instance you usually have to
call setConnection(Connection)
in order to set up the database
on which to operate.
Additionally, it is recommended, that you configure the default time zone
using {setTimeZone(TimeZone)
.
This method does not work in OSGi containers. You should use the service
implementing ISchemaEngineFactory
, which is registered, when jdbc2xml is
deployed inside a blueprint-enabled OSGi container.
META-INF/services/org.clazzes.jdbc2xml.schema.SchemaEngine
.ServiceRegistry.lookupProviders(Class)
public Connection getConnection()
getConnection
in interface ISchemaEngine
public void setConnection(Connection connection) throws SQLException
ISchemaEngine
ISchemaEngine.setDialect(Dialect)
before.
The dialect is retrieved through a call to
IDialectFactory.newDialect(java.sql.DatabaseMetaData)
on
the instance returned by DialectFactory.newInstance()
.
setConnection
in interface ISchemaEngine
connection
- The database connection to set.
SQLException
- If the metadata retrieval on the database failed during
the dialect initialization.public TimeZone getTimeZone()
getTimeZone
in interface ISchemaEngine
public void setTimeZone(TimeZone timeZone)
setTimeZone
in interface ISchemaEngine
timeZone
- The time zone to set.public Dialect getDialect()
getDialect
in interface ISchemaEngine
public void setDialect(Dialect dialect)
ISchemaEngine
ISchemaEngine.setConnection(Connection)
.
setDialect
in interface ISchemaEngine
dialect
- The database dialect to setpublic String getSchema()
getSchema
in interface ISchemaEngine
DatabaseMetaData.getTables(String, String, String, String[])
,
DatabaseMetaData.getColumns(String, String, String, String)
,
DatabaseMetaData.getImportedKeys(String, String, String)
,
DatabaseMetaData.getExportedKeys(String, String, String)
,
DatabaseMetaData.getPrimaryKeys(String, String, String)
public void setSchema(String schema)
setSchema
in interface ISchemaEngine
schema
- The schema to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |