Package org.apache.cayenne.dba.sqlite
Class SQLiteAdapter
java.lang.Object
org.apache.cayenne.dba.JdbcAdapter
org.apache.cayenne.dba.sqlite.SQLiteAdapter
- All Implemented Interfaces:
DbAdapter
A SQLite database adapter that works with Zentus JDBC driver. See
https://www.zentus.com/sqlitejdbc/ for the driver information. Also look at
https://github.com/xerial/sqlite-jdbc for another adapter option.
sqlite.jdbc.url = jdbc:sqlite:sqlitetest.db sqlite.jdbc.driver = org.sqlite.JDBC
- Since:
- 3.0
-
Field Summary
Fields inherited from class org.apache.cayenne.dba.JdbcAdapter
batchQueryBuilderFactory, caseInsensitiveCollations, ejbqlTranslatorFactory, extendedTypes, logger, quotingStrategy, resourceLocator, supportsBatchUpdates, supportsGeneratedKeys, supportsUniqueConstraints, typesHandler
-
Constructor Summary
ConstructorDescriptionSQLiteAdapter
(RuntimeProperties runtimeProperties, List<ExtendedType> defaultExtendedTypes, List<ExtendedType> userExtendedTypes, List<ExtendedTypeFactory> extendedTypeFactories, ResourceLocator resourceLocator, ValueObjectTypeRegistry valueObjectTypeRegistry) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Called fromJdbcAdapter.initExtendedTypes(List, List, List, ValueObjectTypeRegistry)
to load adapter-specific types into the ExtendedTypeMap right after the default types are loaded, but before the DI overrides are.Returns a SQL string that can be used to create a foreign key constraint for the relationship.void
createTableAppendColumn
(StringBuffer sqlBuffer, DbAttribute column) Appends AUTOINCREMENT clause to the column definition for generated columns.protected void
createTableAppendPKClause
(StringBuffer sqlBuffer, DbEntity entity) createUniqueConstraint
(DbEntity source, Collection<DbAttribute> columns) Returns a DDL string to create a unique constraint over a set of columns.Uses JdbcActionBuilder to create the right action.Methods inherited from class org.apache.cayenne.dba.JdbcAdapter
bindParameter, buildAttribute, createEJBQLTranslatorFactory, createPkGenerator, createQuotingStrategy, createTable, dropTableStatements, externalTypesForJdbcType, findResource, getBatchTerminator, getEjbqlTranslatorFactory, getExtendedTypes, getJdbcEventLogger, getPkGenerator, getQuotingStrategy, getSelectTranslator, getSelectTranslator, getSystemCatalogs, getSystemSchemas, getType, initExtendedTypes, setEjbqlTranslatorFactory, setPkGenerator, setSupportsBatchUpdates, setSupportsGeneratedKeys, setSupportsUniqueConstraints, sizeAndPrecision, supportsBatchUpdates, supportsCatalogsOnReverseEngineering, supportsGeneratedKeys, supportsUniqueConstraints, tableTypeForTable, tableTypeForView, typeSupportsLength, unwrap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.cayenne.dba.DbAdapter
supportsGeneratedKeysForBatchInserts
-
Constructor Details
-
SQLiteAdapter
public SQLiteAdapter(RuntimeProperties runtimeProperties, List<ExtendedType> defaultExtendedTypes, List<ExtendedType> userExtendedTypes, List<ExtendedTypeFactory> extendedTypeFactories, ResourceLocator resourceLocator, ValueObjectTypeRegistry valueObjectTypeRegistry)
-
-
Method Details
-
configureExtendedTypes
Description copied from class:JdbcAdapter
Called fromJdbcAdapter.initExtendedTypes(List, List, List, ValueObjectTypeRegistry)
to load adapter-specific types into the ExtendedTypeMap right after the default types are loaded, but before the DI overrides are. This method has specific implementations in JdbcAdapter subclasses.- Overrides:
configureExtendedTypes
in classJdbcAdapter
-
getSqlTreeProcessor
- Specified by:
getSqlTreeProcessor
in interfaceDbAdapter
- Overrides:
getSqlTreeProcessor
in classJdbcAdapter
- Returns:
SQLTreeProcessor
that can adjust SQL tree to specific database flavour- Since:
- 4.2
-
createFkConstraint
Description copied from class:JdbcAdapter
Returns a SQL string that can be used to create a foreign key constraint for the relationship.- Specified by:
createFkConstraint
in interfaceDbAdapter
- Overrides:
createFkConstraint
in classJdbcAdapter
-
createUniqueConstraint
Description copied from class:JdbcAdapter
Returns a DDL string to create a unique constraint over a set of columns.- Specified by:
createUniqueConstraint
in interfaceDbAdapter
- Overrides:
createUniqueConstraint
in classJdbcAdapter
-
getAction
Description copied from class:JdbcAdapter
Uses JdbcActionBuilder to create the right action.- Specified by:
getAction
in interfaceDbAdapter
- Overrides:
getAction
in classJdbcAdapter
-
createTableAppendColumn
Appends AUTOINCREMENT clause to the column definition for generated columns.- Specified by:
createTableAppendColumn
in interfaceDbAdapter
- Overrides:
createTableAppendColumn
in classJdbcAdapter
- Parameters:
sqlBuffer
- theStringBuffer
to append the column type tocolumn
- theDbAttribute
defining the column to append type for
-
createTableAppendPKClause
- Overrides:
createTableAppendPKClause
in classJdbcAdapter
-