Package | Description |
---|---|
com.j256.ormlite.dao |
Database Access Object classes.
|
com.j256.ormlite.db |
Per-database type and SQL information.
|
com.j256.ormlite.field |
Object field information.
|
com.j256.ormlite.table |
Object table information.
|
Modifier and Type | Field and Description |
---|---|
protected DatabaseTableConfig<T> |
BaseDaoImpl.tableConfig |
Modifier and Type | Method and Description |
---|---|
DatabaseTableConfig<T> |
BaseDaoImpl.getTableConfig()
Returns the table configuration information associated with the Dao's class or null if none.
|
Modifier and Type | Method and Description |
---|---|
static <D extends Dao<T,?>,T> |
DaoManager.createDao(ConnectionSource connectionSource,
DatabaseTableConfig<T> tableConfig)
Helper method to create a DAO object without having to define a class.
|
static <T,ID> RuntimeExceptionDao<T,ID> |
RuntimeExceptionDao.createDao(ConnectionSource connectionSource,
DatabaseTableConfig<T> tableConfig)
Call through to
DaoManager.createDao(ConnectionSource, DatabaseTableConfig) with the returned DAO wrapped
in a RuntimeExceptionDao. |
static <D extends Dao<T,?>,T> |
DaoManager.lookupDao(ConnectionSource connectionSource,
DatabaseTableConfig<T> tableConfig)
Helper method to lookup a DAO if it has already been associated with the table-config.
|
void |
BaseDaoImpl.setTableConfig(DatabaseTableConfig<T> tableConfig)
Used if you want to configure the class for the Dao by hand or with spring instead of using the
DatabaseField annotation in the class. |
Modifier and Type | Method and Description |
---|---|
static void |
DaoManager.addCachedDatabaseConfigs(Collection<DatabaseTableConfig<?>> configs)
This adds database table configurations to the internal cache which can be used to speed up DAO construction.
|
Constructor and Description |
---|
BaseDaoImpl(ConnectionSource connectionSource,
DatabaseTableConfig<T> tableConfig)
Construct our base DAO class.
|
Modifier and Type | Method and Description |
---|---|
<T> DatabaseTableConfig<T> |
DatabaseType.extractDatabaseTableConfig(ConnectionSource connectionSource,
Class<T> clazz)
Extract and return a custom database configuration for this class.
|
<T> DatabaseTableConfig<T> |
BaseDatabaseType.extractDatabaseTableConfig(ConnectionSource connectionSource,
Class<T> clazz) |
Modifier and Type | Method and Description |
---|---|
DatabaseTableConfig<?> |
DatabaseFieldConfig.getForeignTableConfig()
For a foreign class which does not use the
DatabaseField annotations, you need to inject the table
configuration. |
Modifier and Type | Method and Description |
---|---|
void |
DatabaseFieldConfig.setForeignTableConfig(DatabaseTableConfig<?> foreignTableConfig) |
Constructor and Description |
---|
DatabaseFieldConfig(String fieldName,
String columnName,
DataType dataType,
String defaultValue,
int width,
boolean canBeNull,
boolean id,
boolean generatedId,
String generatedIdSequence,
boolean foreign,
DatabaseTableConfig<?> foreignTableConfig,
boolean useGetSet,
Enum<?> unknownEnumValue,
boolean throwIfNull,
String format,
boolean unique,
String indexName,
String uniqueIndexName,
boolean autoRefresh,
int maxForeignAutoRefreshLevel,
int maxForeignCollectionLevel) |
Modifier and Type | Method and Description |
---|---|
static <T> DatabaseTableConfig<T> |
DatabaseTableConfig.fromClass(DatabaseType databaseType,
Class<T> clazz)
Extract the DatabaseTableConfig for a particular class by looking for class and field annotations.
|
static <T> DatabaseTableConfig<T> |
DatabaseTableConfigLoader.fromReader(BufferedReader reader)
Load a table configuration in from a text-file reader.
|
Modifier and Type | Method and Description |
---|---|
static List<DatabaseTableConfig<?>> |
DatabaseTableConfigLoader.loadDatabaseConfigFromReader(BufferedReader reader)
Load in a number of database configuration entries from a buffered reader.
|
Modifier and Type | Method and Description |
---|---|
static <T> int |
TableUtils.clearTable(ConnectionSource connectionSource,
DatabaseTableConfig<T> tableConfig)
Clear all data out of the table.
|
static <T> int |
TableUtils.createTable(ConnectionSource connectionSource,
DatabaseTableConfig<T> tableConfig)
Issue the database statements to create the table associated with a table configuration.
|
static <T> int |
TableUtils.createTableIfNotExists(ConnectionSource connectionSource,
DatabaseTableConfig<T> tableConfig)
Create a table if it does not already exist.
|
static <T,ID> int |
TableUtils.dropTable(ConnectionSource connectionSource,
DatabaseTableConfig<T> tableConfig,
boolean ignoreErrors)
Issue the database statements to drop the table associated with a table configuration.
|
static <T,ID> List<String> |
TableUtils.getCreateTableStatements(ConnectionSource connectionSource,
DatabaseTableConfig<T> tableConfig)
Return an list of SQL statements that need to be run to create a table.
|
static <T> void |
DatabaseTableConfigLoader.write(BufferedWriter writer,
DatabaseTableConfig<T> config)
Write the table configuration to a buffered writer.
|
Constructor and Description |
---|
TableInfo(DatabaseType databaseType,
DatabaseTableConfig<T> tableConfig)
Creates a holder of information about a table/class.
|
This documentation is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.