|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.j256.ormlite.table.TableUtils
public class TableUtils
Couple utility methods for the creating, dropping, and maintenance of tables.
| Method Summary | ||
|---|---|---|
static
|
createTable(DatabaseType databaseType,
DataSource dataSource,
Class<T> dataClass)
Issue the database statements to create the table associated with a class. |
|
static
|
createTable(DatabaseType databaseType,
DataSource dataSource,
DatabaseTableConfig<T> tableConfig)
Issue the database statements to create the table associated with a class. |
|
static
|
dropTable(DatabaseType databaseType,
DataSource dataSource,
Class<T> dataClass,
boolean ignoreErrors)
Issue the database statements to create the table associated with a class. |
|
static
|
dropTable(DatabaseType databaseType,
DataSource dataSource,
DatabaseTableConfig<T> tableConfig,
boolean ignoreErrors)
Issue the database statements to create the table associated with a class. |
|
static
|
getCreateTableStatements(DatabaseType databaseType,
Class<T> dataClass)
Return an ordered collection of SQL statements that need to be run to create a table. |
|
static
|
getCreateTableStatements(DatabaseType databaseType,
DatabaseTableConfig<T> tableConfig)
Return an ordered collection of SQL statements that need to be run to create a table. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <T> int createTable(DatabaseType databaseType,
DataSource dataSource,
Class<T> dataClass)
throws SQLException
databaseType - Our database type.dataSource - Associated DataSource.dataClass - The class for which a table will be created.
SQLException
public static <T> int createTable(DatabaseType databaseType,
DataSource dataSource,
DatabaseTableConfig<T> tableConfig)
throws SQLException
databaseType - Our database type.dataSource - Associated DataSource.tableConfig - Hand or spring wired table configuration. If null then the class must have DatabaseField
annotations.
SQLException
public static <T> List<String> getCreateTableStatements(DatabaseType databaseType,
Class<T> dataClass)
throws SQLException
createTable(com.j256.ormlite.db.DatabaseType, javax.sql.DataSource, java.lang.Class) .
databaseType - Our database type.dataClass - The class for which a table will be created.
SQLException
public static <T> List<String> getCreateTableStatements(DatabaseType databaseType,
DatabaseTableConfig<T> tableConfig)
throws SQLException
createTable(com.j256.ormlite.db.DatabaseType, javax.sql.DataSource, java.lang.Class) .
databaseType - Our database type.tableConfig - Hand or spring wired table configuration. If null then the class must have DatabaseField
annotations.
SQLException
public static <T> int dropTable(DatabaseType databaseType,
DataSource dataSource,
Class<T> dataClass,
boolean ignoreErrors)
throws SQLException
WARNING: This is [obviously] very destructive and unrecoverable.
databaseType - Our database type.dataSource - Associated DataSource.dataClass - The class for which a table will be created.ignoreErrors - If set to true then try each statement regardless of SQLException thrown previously.
SQLException
public static <T> int dropTable(DatabaseType databaseType,
DataSource dataSource,
DatabaseTableConfig<T> tableConfig,
boolean ignoreErrors)
throws SQLException
WARNING: This is [obviously] very destructive and unrecoverable.
databaseType - Our database type.dataSource - Associated DataSource.tableConfig - Hand or spring wired table configuration. If null then the class must have DatabaseField
annotations.ignoreErrors - If set to true then try each statement regardless of SQLException thrown previously.
SQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||