Package simpleorm.drivers
Class SDriverMySQL
- java.lang.Object
-
- simpleorm.sessionjdbc.SDriver
-
- simpleorm.drivers.SDriverMySQL
-
public class SDriverMySQL extends SDriver
This contains MySQL specific code.CHAR/VARCHAR max size 255(!) Thence TEXT.
### pierrea@email.com suggests:- (Needs testing) - SDriverMysql should have its own quoteIdentifier using ` instead of " (the character next to the 1 button above the tab button on a std US keyboard). The double quotation fails for the tablenames.
- SDriverMysql should be updated with a new driverName: MySQL-AB JDBC Driver. This is the driver name for all mysql jdbc drivers as posted on Mysql developer section. It might be worthwhile to change the driverName function to return an array of possible names instead of a single name, either that or subclass SDriverMysql to SDriverMMMysql and then include both.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class simpleorm.sessionjdbc.SDriver
SDriver.OffsetStrategy
-
-
Constructor Summary
Constructors Constructor Description SDriverMySQL()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
appendQuotedIdentifier(java.lang.String ident, java.lang.StringBuffer buf)
Wraps identifiers in "s to avoid reserved word issues.protected java.lang.String
driverName()
The driver name to be compared to getMetaData().getDriverName()protected java.lang.String
indexKeySQL(SRecordMeta meta)
ReturnsINDEX (KCOL)
Apparently MySQL needs the index to be created as part of the Create Table statement or it generates errors.protected void
makeForeignKeyIndexSQL(SRecordMeta meta, int fx, SFieldReference fldRef, java.lang.StringBuffer sbFkey, java.lang.StringBuffer sbRefed, java.lang.StringBuffer fkey)
protected java.lang.String
postTablePostParenSQL(SRecordMeta meta)
Any other text to be added after the final ")"boolean
supportsLocking()
### This assuems their "innoDB" mode.-
Methods inherited from class simpleorm.sessionjdbc.SDriver
addNull, alterTableAddColumnSQL, alterTableDropColumnSQL, appendColumnName, appendQuotedIdentifier, appendTableName, clauseSeparator, columnTypeSQL, createSequenceDDL, createTableSQL, deleteSQL, dropSequenceDDL, dropTableNoError, foreignKeysSQL, forUpdateSQL, fromSQL, generateKeySelectMax, generateKeySequence, getLogger, getOffsetStrategy, getSession, insertSQL, joinSQL, limitSQL, mapForeignKeys, maxIdentNameLength, postColumnSQL, postFromSQL, postTablePreParenSQL, primaryKeySQL, queryExecuteFactory, registerDriver, selectSQL, selectSQL, supportsKeySequences, updateSQL, whereSQL, wholeColumnSQL
-
-
-
-
Method Detail
-
driverName
protected java.lang.String driverName()
Description copied from class:SDriver
The driver name to be compared to getMetaData().getDriverName()- Overrides:
driverName
in classSDriver
-
appendQuotedIdentifier
protected void appendQuotedIdentifier(java.lang.String ident, java.lang.StringBuffer buf)
Description copied from class:SDriver
Wraps identifiers in "s to avoid reserved word issues. (Override this for dbs that use different chars, eg [xxx] for MS-SQL. We do quote these days to avoid the endless problems with reserved words.- Overrides:
appendQuotedIdentifier
in classSDriver
-
postTablePostParenSQL
protected java.lang.String postTablePostParenSQL(SRecordMeta meta)
Any other text to be added after the final ")"- Overrides:
postTablePostParenSQL
in classSDriver
-
supportsLocking
public boolean supportsLocking()
### This assuems their "innoDB" mode. Not true for traditional MySQL. Needs work.- Overrides:
supportsLocking
in classSDriver
-
indexKeySQL
protected java.lang.String indexKeySQL(SRecordMeta meta)
ReturnsINDEX (KCOL)
Apparently MySQL needs the index to be created as part of the Create Table statement or it generates errors. I don't think any other DBs support INDEX clauses.- Overrides:
indexKeySQL
in classSDriver
-
makeForeignKeyIndexSQL
protected void makeForeignKeyIndexSQL(SRecordMeta meta, int fx, SFieldReference fldRef, java.lang.StringBuffer sbFkey, java.lang.StringBuffer sbRefed, java.lang.StringBuffer fkey)
- Overrides:
makeForeignKeyIndexSQL
in classSDriver
-
-