public class SDriverMSSQL extends SDriver
CHAR, VARCHAR max 8,000. TEXT 2^31. NVARCHAR/NCHAR UTF16, max size 4,000.
SDriver.OffsetStrategy
Constructor and Description |
---|
SDriverMSSQL() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
alterTableAddColumnSQL(SFieldScalar field)
These alow you to create a new SFieldMeta object at runtime and then
update the table to include it.
|
protected java.lang.String |
columnTypeSQL(SFieldScalar field,
java.lang.String defalt)
Apparently need DATETIME instead of TIMESTAMP
|
protected java.lang.String |
driverName()
The driver name to be compared to getMetaData().getDriverName()
|
protected java.lang.String |
forUpdateSQL(boolean forUpdate)
Returns update clause, may not be valid in certain lock modes etc.
|
boolean |
getXLockEnabled() |
protected java.lang.String |
postFromSQL(boolean forUpdate)
It is unclear how MS SQL 2005 does snapshot locking -- very complex,
needs experimentation.
|
void |
setXLockEnabled(boolean xlock)
Enables WITH (XLOCK) for updatable queries.
|
addNull, alterTableDropColumnSQL, appendColumnName, appendQuotedIdentifier, appendQuotedIdentifier, appendTableName, clauseSeparator, createSequenceDDL, createTableSQL, deleteSQL, dropSequenceDDL, dropTableNoError, foreignKeysSQL, fromSQL, generateKeySelectMax, generateKeySequence, getLogger, getOffsetStrategy, getSession, indexKeySQL, insertSQL, joinSQL, limitSQL, makeForeignKeyIndexSQL, mapForeignKeys, maxIdentNameLength, postColumnSQL, postTablePostParenSQL, postTablePreParenSQL, primaryKeySQL, queryExecuteFactory, registerDriver, selectSQL, selectSQL, supportsKeySequences, supportsLocking, updateSQL, whereSQL, wholeColumnSQL
protected java.lang.String driverName()
SDriver
driverName
in class SDriver
protected java.lang.String columnTypeSQL(SFieldScalar field, java.lang.String defalt)
columnTypeSQL
in class SDriver
protected java.lang.String forUpdateSQL(boolean forUpdate)
SDriver
Oracle, Postgresql, and new in MS SQL 2005 support data versioning or snapshots. This means that repeatable read is achieved by caching the previous value read instead of using read locks. This approach makes it critical to add FOR UPDATE where appropriate or there is effectively no locking.
Indeed, in Oracle, you are guaranteed that several SELECTS will return the same value, but a subsequent SELECT FOR UPDATE in the same transaction may return a different value.
forUpdateSQL
in class SDriver
protected java.lang.String postFromSQL(boolean forUpdate)
Need for XLOCK is unclear. However, Jorge says that it is unnecessary and makes SimpleORM fail, but it works for me.
postFromSQL
in class SDriver
for discussion.
public void setXLockEnabled(boolean xlock)
public boolean getXLockEnabled()
public java.lang.String alterTableAddColumnSQL(SFieldScalar field)
SDriver
alterTableAddColumnSQL
in class SDriver