com.j256.ormlite.db
Class MysqlDatabaseType

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

public class MysqlDatabaseType
extends com.j256.ormlite.db.BaseDatabaseType
implements com.j256.ormlite.db.DatabaseType

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

NOTE: By default the tables are created with the ENGINE=InnoDB suffix (see DEFAULT_CREATE_TABLE_SUFFIX. Use setCreateTableSuffix(java.lang.String) to change that to "" to use the default MyISAM storage engine, to choose another engine, or set other settings. For more information about engines, see the 'SHOW ENGINES;' results from the MySQL command line tool.

Author:
graywatson

Nested Class Summary
 
Nested classes/interfaces inherited from class com.j256.ormlite.db.BaseDatabaseType
com.j256.ormlite.db.BaseDatabaseType.BooleanNumberFieldConverter
 
Field Summary
static String DEFAULT_CREATE_TABLE_SUFFIX
          Default suffix to the CREATE TABLE statement.
 
Fields inherited from class com.j256.ormlite.db.BaseDatabaseType
DEFAULT_SEQUENCE_SUFFIX, driver
 
Constructor Summary
MysqlDatabaseType()
           
 
Method Summary
protected  void appendBooleanType(StringBuilder sb, int fieldWidth)
           
 void appendCreateTableSuffix(StringBuilder sb)
           
protected  void appendDateType(StringBuilder sb, int fieldWidth)
           
protected  void configureGeneratedId(String tableName, StringBuilder sb, com.j256.ormlite.field.FieldType fieldType, List<String> statementsBefore, List<String> statementsAfter, List<String> additionalArgs, List<String> queriesAfter)
           
 String getDatabaseName()
           
protected  String getDriverClassName()
           
 boolean isCreateIfNotExistsSupported()
           
 boolean isDatabaseUrlThisType(String url, String dbTypePart)
           
 boolean isTruncateSupported()
           
 void setCreateTableSuffix(String createTableSuffix)
          Set the string that is appended to the end of a CREATE TABLE statement.
 
Methods inherited from class com.j256.ormlite.db.BaseDatabaseType
addPrimaryKeySql, addUniqueComboSql, appendByteArrayType, appendByteType, appendCharType, appendColumnArg, appendEscapedEntityName, appendEscapedWord, appendLimitValue, appendLongStringType, appendLongType, appendOffsetValue, appendSelectNextValFromSequence, appendSerializableType, appendShortType, appendStringType, configureGeneratedIdSequence, configureId, dropColumnArg, generatedIdSqlAtEnd, generateIdSequenceName, getCommentLinePrefix, getFieldConverter, getPingStatement, isAllowGeneratedIdInsertSupported, isBatchUseTransaction, isCreateTableReturnsZero, isEntityNamesMustBeUpCase, isIdSequenceNeeded, isLimitAfterSelect, isLimitSqlSupported, isNestedSavePointsSupported, isOffsetLimitArgument, isOffsetSqlSupported, isSelectSequenceBeforeInsert, isVarcharFieldWidthSupported, 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, appendEscapedEntityName, appendEscapedWord, appendLimitValue, appendOffsetValue, appendSelectNextValFromSequence, dropColumnArg, generateIdSequenceName, getCommentLinePrefix, getFieldConverter, getPingStatement, isAllowGeneratedIdInsertSupported, isBatchUseTransaction, isCreateTableReturnsZero, isEntityNamesMustBeUpCase, isIdSequenceNeeded, isLimitAfterSelect, isLimitSqlSupported, isNestedSavePointsSupported, isOffsetLimitArgument, isOffsetSqlSupported, isSelectSequenceBeforeInsert, isVarcharFieldWidthSupported, loadDriver, setDriver
 

Field Detail

DEFAULT_CREATE_TABLE_SUFFIX

public static final String DEFAULT_CREATE_TABLE_SUFFIX
Default suffix to the CREATE TABLE statement. Change with the setCreateTableSuffix(java.lang.String) method.

See Also:
Constant Field Values
Constructor Detail

MysqlDatabaseType

public MysqlDatabaseType()
Method Detail

isDatabaseUrlThisType

public boolean isDatabaseUrlThisType(String url,
                                     String dbTypePart)
Specified by:
isDatabaseUrlThisType in interface com.j256.ormlite.db.DatabaseType

getDriverClassName

protected String getDriverClassName()
Specified by:
getDriverClassName in class com.j256.ormlite.db.BaseDatabaseType

getDatabaseName

public String getDatabaseName()
Specified by:
getDatabaseName in interface com.j256.ormlite.db.DatabaseType

setCreateTableSuffix

public void setCreateTableSuffix(String createTableSuffix)
Set the string that is appended to the end of a CREATE TABLE statement.


appendDateType

protected void appendDateType(StringBuilder sb,
                              int fieldWidth)
Overrides:
appendDateType in class com.j256.ormlite.db.BaseDatabaseType

appendBooleanType

protected void appendBooleanType(StringBuilder sb,
                                 int fieldWidth)
Overrides:
appendBooleanType in class com.j256.ormlite.db.BaseDatabaseType

configureGeneratedId

protected void configureGeneratedId(String tableName,
                                    StringBuilder sb,
                                    com.j256.ormlite.field.FieldType fieldType,
                                    List<String> statementsBefore,
                                    List<String> statementsAfter,
                                    List<String> additionalArgs,
                                    List<String> queriesAfter)
Overrides:
configureGeneratedId in class com.j256.ormlite.db.BaseDatabaseType

appendCreateTableSuffix

public void appendCreateTableSuffix(StringBuilder sb)
Specified by:
appendCreateTableSuffix in interface com.j256.ormlite.db.DatabaseType
Overrides:
appendCreateTableSuffix in class com.j256.ormlite.db.BaseDatabaseType

isTruncateSupported

public boolean isTruncateSupported()
Specified by:
isTruncateSupported in interface com.j256.ormlite.db.DatabaseType
Overrides:
isTruncateSupported in class com.j256.ormlite.db.BaseDatabaseType

isCreateIfNotExistsSupported

public boolean isCreateIfNotExistsSupported()
Specified by:
isCreateIfNotExistsSupported in interface com.j256.ormlite.db.DatabaseType
Overrides:
isCreateIfNotExistsSupported in class com.j256.ormlite.db.BaseDatabaseType


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