Package simpleorm.drivers
Class SDriverMySQL
java.lang.Object
simpleorm.sessionjdbc.SDriver
simpleorm.drivers.SDriverMySQL
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 -
Method Summary
Modifier and TypeMethodDescriptionprotected void
appendQuotedIdentifier
(String ident, StringBuffer buf) Wraps identifiers in "s to avoid reserved word issues.protected String
The driver name to be compared to getMetaData().getDriverName()protected 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, StringBuffer sbFkey, StringBuffer sbRefed, StringBuffer fkey) protected String
Any other text to be added after the final ")"boolean
### 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
-
Constructor Details
-
SDriverMySQL
public SDriverMySQL()
-
-
Method Details
-
driverName
Description copied from class:SDriver
The driver name to be compared to getMetaData().getDriverName()- Overrides:
driverName
in classSDriver
-
appendQuotedIdentifier
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
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
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, StringBuffer sbFkey, StringBuffer sbRefed, StringBuffer fkey) - Overrides:
makeForeignKeyIndexSQL
in classSDriver
-