com.j256.ormlite.db
Class BaseSqliteDatabaseType

java.lang.Object
  extended by com.j256.ormlite.db.BaseDatabaseType
      extended by com.j256.ormlite.db.BaseSqliteDatabaseType
All Implemented Interfaces:
DatabaseType

public abstract class BaseSqliteDatabaseType
extends BaseDatabaseType
implements DatabaseType

Sqlite database type information used to create the tables, etc..

NOTE: We need this here because the Android version subclasses it.

Author:
graywatson

Nested Class Summary
 
Nested classes/interfaces inherited from class com.j256.ormlite.db.BaseDatabaseType
BaseDatabaseType.BooleanNumberFieldConverter
 
Field Summary
 
Fields inherited from class com.j256.ormlite.db.BaseDatabaseType
DEFAULT_SEQUENCE_SUFFIX, driver
 
Constructor Summary
BaseSqliteDatabaseType()
           
 
Method Summary
protected  void appendLongType(StringBuilder sb, FieldType fieldType, int fieldWidth)
          Output the SQL type for a Java long.
protected  void configureGeneratedId(String tableName, StringBuilder sb, FieldType fieldType, List<String> statementsBefore, List<String> statementsAfter, List<String> additionalArgs, List<String> queriesAfter)
          Output the SQL necessary to configure a generated-id column.
protected  boolean generatedIdSqlAtEnd()
          Return true if we should add generated-id SQL in the BaseDatabaseType.addPrimaryKeySql(com.j256.ormlite.field.FieldType[], java.util.List, java.util.List, java.util.List, java.util.List) method at the end.
 FieldConverter getFieldConverter(DataPersister dataPersister)
          Return the FieldConverter to associate with the DataType.
 boolean isCreateIfNotExistsSupported()
          Returns true if the table creation IF NOT EXISTS syntax is supported.
 boolean isCreateTableReturnsZero()
          Returns true if a 'CREATE TABLE' statement should return 0.
 boolean isVarcharFieldWidthSupported()
          Return true if the database supports the width parameter on VARCHAR fields.
 
Methods inherited from class com.j256.ormlite.db.BaseDatabaseType
addPrimaryKeySql, addUniqueComboSql, appendBigDecimalNumericType, appendBooleanType, appendByteArrayType, appendByteType, appendCharType, appendColumnArg, appendCreateTableSuffix, appendDateType, appendEscapedEntityName, appendEscapedWord, appendLimitValue, appendLongStringType, appendOffsetValue, appendSelectNextValFromSequence, appendSerializableType, appendShortType, appendStringType, configureGeneratedIdSequence, configureId, dropColumnArg, extractDatabaseTableConfig, generateIdSequenceName, getCommentLinePrefix, getDriverClassName, getPingStatement, isAllowGeneratedIdInsertSupported, isBatchUseTransaction, isCreateIndexIfNotExistsSupported, isCreateTableReturnsNegative, isEntityNamesMustBeUpCase, isIdSequenceNeeded, isLimitAfterSelect, isLimitSqlSupported, isNestedSavePointsSupported, isOffsetLimitArgument, isOffsetSqlSupported, isSelectSequenceBeforeInsert, isTruncateSupported, loadDriver, setDriver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.j256.ormlite.db.DatabaseType
addPrimaryKeySql, addUniqueComboSql, appendColumnArg, appendCreateTableSuffix, appendEscapedEntityName, appendEscapedWord, appendLimitValue, appendOffsetValue, appendSelectNextValFromSequence, dropColumnArg, extractDatabaseTableConfig, generateIdSequenceName, getCommentLinePrefix, getDatabaseName, getPingStatement, isAllowGeneratedIdInsertSupported, isBatchUseTransaction, isCreateIndexIfNotExistsSupported, isCreateTableReturnsNegative, isDatabaseUrlThisType, isEntityNamesMustBeUpCase, isIdSequenceNeeded, isLimitAfterSelect, isLimitSqlSupported, isNestedSavePointsSupported, isOffsetLimitArgument, isOffsetSqlSupported, isSelectSequenceBeforeInsert, isTruncateSupported, loadDriver, setDriver
 

Constructor Detail

BaseSqliteDatabaseType

public BaseSqliteDatabaseType()
Method Detail

appendLongType

protected void appendLongType(StringBuilder sb,
                              FieldType fieldType,
                              int fieldWidth)
Description copied from class: BaseDatabaseType
Output the SQL type for a Java long.

Overrides:
appendLongType in class BaseDatabaseType

configureGeneratedId

protected void configureGeneratedId(String tableName,
                                    StringBuilder sb,
                                    FieldType fieldType,
                                    List<String> statementsBefore,
                                    List<String> statementsAfter,
                                    List<String> additionalArgs,
                                    List<String> queriesAfter)
Description copied from class: BaseDatabaseType
Output the SQL necessary to configure a generated-id column. This may add to the before statements list or additional arguments later. NOTE: Only one of configureGeneratedIdSequence, configureGeneratedId, or configureId will be called.

Overrides:
configureGeneratedId in class BaseDatabaseType

generatedIdSqlAtEnd

protected boolean generatedIdSqlAtEnd()
Description copied from class: BaseDatabaseType
Return true if we should add generated-id SQL in the BaseDatabaseType.addPrimaryKeySql(com.j256.ormlite.field.FieldType[], java.util.List, java.util.List, java.util.List, java.util.List) method at the end. If false then it needs to be done by hand inline.

Overrides:
generatedIdSqlAtEnd in class BaseDatabaseType

isVarcharFieldWidthSupported

public boolean isVarcharFieldWidthSupported()
Description copied from interface: DatabaseType
Return true if the database supports the width parameter on VARCHAR fields.

Specified by:
isVarcharFieldWidthSupported in interface DatabaseType
Overrides:
isVarcharFieldWidthSupported in class BaseDatabaseType

isCreateTableReturnsZero

public boolean isCreateTableReturnsZero()
Description copied from interface: DatabaseType
Returns true if a 'CREATE TABLE' statement should return 0. False if > 0.

Specified by:
isCreateTableReturnsZero in interface DatabaseType
Overrides:
isCreateTableReturnsZero in class BaseDatabaseType

isCreateIfNotExistsSupported

public boolean isCreateIfNotExistsSupported()
Description copied from interface: DatabaseType
Returns true if the table creation IF NOT EXISTS syntax is supported.

Specified by:
isCreateIfNotExistsSupported in interface DatabaseType
Overrides:
isCreateIfNotExistsSupported in class BaseDatabaseType

getFieldConverter

public FieldConverter getFieldConverter(DataPersister dataPersister)
Description copied from interface: DatabaseType
Return the FieldConverter to associate with the DataType. This allows the database instance to convert a field as necessary before it goes to the database.

Specified by:
getFieldConverter in interface DatabaseType
Overrides:
getFieldConverter in class BaseDatabaseType


This documentation is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.