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

      public class SQLiteAdapter
      extends JdbcAdapter

  A SQLite database adapter that works with Zentus JDBC driver. See http://www.zentus.com/sqlitejdbc/ for the driver information. Also look at http://www.xerial.org/trac/Xerial/wiki/SQLiteJDBC for another adaptor 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

    Constructors
    Constructor and Description
    `SQLiteAdapter(RuntimeProperties runtimeProperties, List<ExtendedType> defaultExtendedTypes, List<ExtendedType> userExtendedTypes, List<ExtendedTypeFactory> extendedTypeFactories, ResourceLocator resourceLocator, ValueObjectTypeRegistry valueObjectTypeRegistry)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `configureExtendedTypes(ExtendedTypeMap map)` Called from `JdbcAdapter.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.
    `String` | `createFkConstraint(DbRelationship rel)` 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)`
    `String` | `createUniqueConstraint(DbEntity source, Collection<DbAttribute> columns)` Returns a DDL string to create a unique constraint over a set of columns.
    `SQLAction` | `getAction(Query query, DataNode node)` Uses JdbcActionBuilder to create the right action.
    `QualifierTranslator` | `getQualifierTranslator(QueryAssembler queryAssembler)` Creates and returns a default implementation of a qualifier translator.

    - ### Methods inherited from class org.apache.cayenne.dba.JdbcAdapter

      `bindParameter, buildAttribute, createEJBQLTranslatorFactory, createPkGenerator, createQuotingStrategy, createTable, dropTableStatements, externalTypesForJdbcType, findResource, getBatchQueryBuilderFactory, getBatchTerminator, getEjbqlTranslatorFactory, getExtendedTypes, getJdbcEventLogger, getPkGenerator, getQuotingStrategy, getQuotingStrategy, getSelectTranslator, getType, initExtendedTypes, setBatchQueryBuilderFactory, 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`

- - ### Constructor Detail

    - #### SQLiteAdapter

          public SQLiteAdapter(RuntimeProperties runtimeProperties,
                               List<ExtendedType> defaultExtendedTypes,
                               List<ExtendedType> userExtendedTypes,
                               List<ExtendedTypeFactory> extendedTypeFactories,
                               ResourceLocator resourceLocator,
                               ValueObjectTypeRegistry valueObjectTypeRegistry)

  - ### Method Detail

    - #### configureExtendedTypes

          protected void configureExtendedTypes(ExtendedTypeMap map)

      Description copied from class: `JdbcAdapter`
      Called from `JdbcAdapter.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 class `JdbcAdapter`

    - #### getQualifierTranslator

          public QualifierTranslator getQualifierTranslator(QueryAssembler queryAssembler)

      Description copied from class: `JdbcAdapter`
      Creates and returns a default implementation of a qualifier translator.
      Specified by:
        `getQualifierTranslator` in interface `DbAdapter`
      Overrides:
        `getQualifierTranslator` in class `JdbcAdapter`
      Since:
        4.0

    - #### createFkConstraint

          public String createFkConstraint(DbRelationship rel)

      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 interface `DbAdapter`
      Overrides:
        `createFkConstraint` in class `JdbcAdapter`

    - #### createUniqueConstraint

          public String createUniqueConstraint(DbEntity source,
                                               Collection<DbAttribute> columns)

      Description copied from class: `JdbcAdapter`
      Returns a DDL string to create a unique constraint over a set of columns.
      Specified by:
        `createUniqueConstraint` in interface `DbAdapter`
      Overrides:
        `createUniqueConstraint` in class `JdbcAdapter`

    - #### getAction

          public SQLAction getAction(Query query,
                                     DataNode node)

      Description copied from class: `JdbcAdapter`
      Uses JdbcActionBuilder to create the right action.
      Specified by:
        `getAction` in interface `DbAdapter`
      Overrides:
        `getAction` in class `JdbcAdapter`

    - #### createTableAppendColumn

          public void createTableAppendColumn(StringBuffer sqlBuffer,
                                              DbAttribute column)

      Appends AUTOINCREMENT clause to the column definition for generated columns.
      Specified by:
        `createTableAppendColumn` in interface `DbAdapter`
      Overrides:
        `createTableAppendColumn` in class `JdbcAdapter`
      Parameters:
        `sqlBuffer` - the `StringBuffer` to append the column type to
        `column` - the `DbAttribute` defining the column to append type for

    - #### createTableAppendPKClause

          protected void createTableAppendPKClause(StringBuffer sqlBuffer,
                                                   DbEntity entity)

      Overrides:
        `createTableAppendPKClause` in class `JdbcAdapter`

Copyright © 2001–2023 Apache Cayenne. All rights reserved.