org.eclipse.net4j.db.mysql
Class MYSQLAdapter

java.lang.Object
  extended by org.eclipse.net4j.spi.db.DBAdapter
      extended by org.eclipse.net4j.db.mysql.MYSQLAdapter
All Implemented Interfaces:
IDBAdapter

public class MYSQLAdapter
extends DBAdapter

A DB adapter for MySQL databases.

Since:
2.0

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.net4j.spi.db.DBAdapter
DBAdapter.FieldInfo
 
Field Summary
static String NAME
           
static String VERSION
           
 
Fields inherited from interface org.eclipse.net4j.db.IDBAdapter
REGISTRY
 
Constructor Summary
MYSQLAdapter()
           
 
Method Summary
protected  void addIndexField(StringBuilder builder, IDBField field)
           
protected  void dropPrimaryKey(IDBIndex index, StringBuilder builder)
           
 int getMaxFieldNameLength()
           
 int getMaxTableNameLength()
           
 String[] getReservedWords()
           
protected  String getTypeName(IDBField field)
           
 boolean isDuplicateKeyException(SQLException ex)
          Check if an exception indicates a constraint violation (duplicate key)
 boolean isTypeIndexable(DBType type)
           
protected  String sqlModifyField(String tableName, String fieldName, String definition)
           
 String sqlRenameField(IDBField field, String oldName)
           
 
Methods inherited from class org.eclipse.net4j.spi.db.DBAdapter
adaptType, addIndex, alterTable, appendFieldDefs, appendFieldNames, createConstraints, createFieldDefinition, createFieldDefinitions, createIndex, createIndex, createIndex, createIndexFields, createJDBCDataSource, createPrimaryKey, createTable, createTable, createTables, doCreateTable, dropIndex, dropIndex, dropTable, dropTable, dropTables, format, format, getDefaultDBLength, getDropTableSQL, getFieldLength, getJDBCDriver, getName, getSQL92ReservedWords, getVersion, isColumnNotFoundException, isPrimaryKeyShadow, isReservedWord, isTableNotFoundException, isValidFirstChar, readFields, readIndices, readIndices, readSchema, readSchema, sqlModifyField, toString, updateSchema, validateTable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NAME

public static final String NAME
See Also:
Constant Field Values

VERSION

public static final String VERSION
See Also:
Constant Field Values
Constructor Detail

MYSQLAdapter

public MYSQLAdapter()
Method Detail

getMaxTableNameLength

public int getMaxTableNameLength()
Specified by:
getMaxTableNameLength in interface IDBAdapter
Overrides:
getMaxTableNameLength in class DBAdapter
Since:
2.0

getMaxFieldNameLength

public int getMaxFieldNameLength()
Specified by:
getMaxFieldNameLength in interface IDBAdapter
Overrides:
getMaxFieldNameLength in class DBAdapter
Since:
2.0

getTypeName

protected String getTypeName(IDBField field)
Overrides:
getTypeName in class DBAdapter

dropPrimaryKey

protected void dropPrimaryKey(IDBIndex index,
                              StringBuilder builder)
Overrides:
dropPrimaryKey in class DBAdapter

addIndexField

protected void addIndexField(StringBuilder builder,
                             IDBField field)
Overrides:
addIndexField in class DBAdapter

getReservedWords

public String[] getReservedWords()

isTypeIndexable

public boolean isTypeIndexable(DBType type)
Specified by:
isTypeIndexable in interface IDBAdapter
Overrides:
isTypeIndexable in class DBAdapter

isDuplicateKeyException

public boolean isDuplicateKeyException(SQLException ex)
Description copied from interface: IDBAdapter
Check if an exception indicates a constraint violation (duplicate key)

Specified by:
isDuplicateKeyException in interface IDBAdapter
Overrides:
isDuplicateKeyException in class DBAdapter

sqlRenameField

public String sqlRenameField(IDBField field,
                             String oldName)
Specified by:
sqlRenameField in interface IDBAdapter
Overrides:
sqlRenameField in class DBAdapter

sqlModifyField

protected String sqlModifyField(String tableName,
                                String fieldName,
                                String definition)
Overrides:
sqlModifyField in class DBAdapter


Copyright (c) 2011, 2012 Eike Stepper (Berlin, Germany) and others.