java.lang.Object
org.objectstyle.cayenne.dba.JdbcAdapter
org.objectstyle.cayenne.dba.mysql.MySQLAdapter
- All Implemented Interfaces:
- org.objectstyle.cayenne.dba.DbAdapter
- public class MySQLAdapter
- extends org.objectstyle.cayenne.dba.JdbcAdapter
DbAdapter implementation for MySQL RDBMS.
Sample connection
settings to use with MySQL are shown below:
test-mysql.cayenne.adapter = org.objectstyle.cayenne.dba.mysql.MySQLAdapter
test-mysql.jdbc.username = test
test-mysql.jdbc.password = secret
test-mysql.jdbc.url = jdbc:mysql://serverhostname/cayenne
test-mysql.jdbc.driver = org.gjt.mm.mysql.Driver
| Methods inherited from class org.objectstyle.cayenne.dba.JdbcAdapter |
bindParameter, buildAttribute, configureExtendedTypes, createDataNode, createTable, dropTable, externalTypesForJdbcType, getExtendedTypes, getPkGenerator, getQualifierTranslator, getQueryTranslator, queryTranslatorClass, setSupportsBatchUpdates, shouldRunBatchQuery, supportsBatchUpdates, tableTypeForTable |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MySQLAdapter
public MySQLAdapter()
supportsFkConstraints
public boolean supportsFkConstraints()
- Description copied from class:
org.objectstyle.cayenne.dba.JdbcAdapter
- Returns true.
createFkConstraint
public java.lang.String createFkConstraint(org.objectstyle.cayenne.map.DbRelationship rel)
- Throws an exception, since FK constraints are not supported by MySQL.
tableTypeForView
public java.lang.String tableTypeForView()
- Returns null, since views are not yet supported in MySQL. Views
support is promised in MySQL 4.1.
createPkGenerator
protected org.objectstyle.cayenne.dba.PkGenerator createPkGenerator()
- Creates and returns a primary key generator. Overrides superclass
implementation to return an
instance of MySQLPkGenerator that does the correct table locking.