public class SQLServer extends AnsiStandard
| Modifier and Type | Class and Description |
|---|---|
static class |
SQLServer.SQLServerBooleanPoemType
Translates an SQLServer Boolean into a Poem
BooleanPoemType. |
| Modifier and Type | Field and Description |
|---|---|
static int |
sqlServerMaxBinarySize
Maximum size of a binary field.
|
static int |
sqlServerTextHack
SQL Server does not have a pleasant
TEXT datatype, so we use
an arbetary value in a VARCHAR. |
| Constructor and Description |
|---|
SQLServer()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
String |
alterColumnNotNullableSQL(String tableName,
Column<?> column)
Accommodate SQLServer syntax.
|
String |
booleanTrueExpression(Column<Boolean> booleanColumn)
Accommodate lack of boolean types in underlying DBMS.
|
boolean |
canBeIndexed(Column<?> column)
MSSQL cannot index TEXT fields.
|
<S,O> PoemType<O> |
canRepresent(PoemType<S> storage,
PoemType<O> type)
Accomodate our String size hack.
|
String |
caseInsensitiveRegExpSQL(String term1,
String term2)
This is the Postgresql syntax.
|
SQLPoemType<?> |
defaultPoemTypeOfColumnMetaData(ResultSet md)
The simplest POEM type corresponding to a JDBC description from the
database.
|
String |
getBinarySqlDefinition(int size)
Accommodate different treatment of different sized binary data.
|
String |
getForeignKeyDefinition(String tableName,
String fieldName,
String targetTableName,
String targetTableFieldName,
String fixName)
Slightly different - embrace and extend.
|
String |
getLongSqlDefinition()
Accommodate Long / Bigint deviants.
|
String |
getQuotedValue(SQLType<?> sqlType,
String value)
Accommodate different quoting strategies for values.
|
String |
getSchema()
Get the user we are connected as and return that as the schema.
|
String |
getSqlDefaultValue(SQLType<?> sqlType)
Used to set a not null value when
creating a non nullable column.
|
String |
getSqlDefinition(String sqlTypeName)
Retrieve a SQL type keyword used by the DBMS
for the given Melati type name.
|
String |
getStringSqlDefinition(int size)
Accommodate String / Text distinction.
|
String |
melatiName(String name)
Ignore dtproperties as it is a 'System' table used to store
Entity Relationship diagrams which have a jdbc type of TABLE when it should
probably have a jdbc type of 'SYSTEM TABLE'.
|
String |
selectLimit(String querySelection,
int limit)
Accommodate different limiting syntax.
|
String |
sqlBooleanValueOfRaw(Object raw)
Accommodate different true and false values.
|
alterColumnAddCommentSQL, alterTableAddCommentSQL, canDropColumns, canStoreBlobs, createTableOptionsSql, createTableSql, createTableTypeQualifierSql, exceptionForUpdate, exceptionForUpdate, getConnection, getFixedPtSqlDefinition, getIndexLength, getJdbcMetadataName, getPrimaryKeyDefinition, getQuotedName, givesCapabilitySQL, preparedStatementPlaceholder, shutdown, tableInitialisationSql, toString, unloadDriver, unreservedNamepublic static final int sqlServerTextHack
TEXT datatype, so we use
an arbetary value in a VARCHAR.public static final int sqlServerMaxBinarySize
public String getSchema()
getSchema in interface DbmsgetSchema in class AnsiStandardDbms.getSchema(),
AnsiStandard.getSchema()public String getSqlDefinition(String sqlTypeName)
getSqlDefinition in interface DbmsgetSqlDefinition in class AnsiStandardsqlTypeName - the Melati internal type nameAnsiStandard.getSqlDefinition(java.lang.String)public String getStringSqlDefinition(int size) throws SQLException
getStringSqlDefinition in interface DbmsgetStringSqlDefinition in class AnsiStandardsize - the string length (-1 means no limit)SQLExceptionAnsiStandard.getStringSqlDefinition(int)public <S,O> PoemType<O> canRepresent(PoemType<S> storage, PoemType<O> type)
canRepresent in interface DbmscanRepresent in class AnsiStandardstorage - the containertype - the type to storeAnsiStandard.canRepresent(org.melati.poem.PoemType<S>, org.melati.poem.PoemType<O>)public String sqlBooleanValueOfRaw(Object raw)
sqlBooleanValueOfRaw in interface DbmssqlBooleanValueOfRaw in class AnsiStandardAnsiStandard.sqlBooleanValueOfRaw(java.lang.Object)public String getLongSqlDefinition()
getLongSqlDefinition in interface DbmsgetLongSqlDefinition in class AnsiStandardDbms.getLongSqlDefinition()public String getBinarySqlDefinition(int size) throws SQLException
getBinarySqlDefinition in interface DbmsgetBinarySqlDefinition in class AnsiStandardsize - how big the field isSQLExceptionDbms.getBinarySqlDefinition(int)public SQLPoemType<?> defaultPoemTypeOfColumnMetaData(ResultSet md) throws SQLException
defaultPoemTypeOfColumnMetaData in interface DbmsdefaultPoemTypeOfColumnMetaData in class AnsiStandardmd - the JDBC metadataSQLException - potentiallyAnsiStandard.defaultPoemTypeOfColumnMetaData(
java.sql.ResultSet)public String melatiName(String name)
melatiName in interface DbmsmelatiName in class AnsiStandardname - an SQL nameAnsiStandard.melatiName(java.lang.String)public boolean canBeIndexed(Column<?> column)
canBeIndexed in interface DbmscanBeIndexed in class AnsiStandardcolumn - the POEM Column we are dealing withpublic String caseInsensitiveRegExpSQL(String term1, String term2)
caseInsensitiveRegExpSQL in interface DbmscaseInsensitiveRegExpSQL in class AnsiStandardterm1 - the term to find interm2 - the quoted term to findAnsiStandard.caseInsensitiveRegExpSQL(java.lang.String, java.lang.String)public String getForeignKeyDefinition(String tableName, String fieldName, String targetTableName, String targetTableFieldName, String fixName)
getForeignKeyDefinition in interface DbmsgetForeignKeyDefinition in class AnsiStandardtableName - the table that this column is in, unquotedfieldName - often the name of the foreign table, unquotedtargetTableName - the table that this is a foreign key into, unquotedtargetTableFieldName - name of the primary key field of the foreign
table, often id, unquotedfixName - name of the IntegrityFixpublic String alterColumnNotNullableSQL(String tableName, Column<?> column)
alterColumnNotNullableSQL in interface DbmsalterColumnNotNullableSQL in class AnsiStandardpublic String selectLimit(String querySelection, int limit)
selectLimit in interface DbmsselectLimit in class AnsiStandardquerySelection - main body of querylimit - number to limit toDbms.selectLimit(java.lang.String, int)public String booleanTrueExpression(Column<Boolean> booleanColumn)
booleanTrueExpression in interface DbmsbooleanTrueExpression in class AnsiStandardbooleanColumn - the column which should be a booleanDbms.booleanTrueExpression(org.melati.poem.Column)public String getSqlDefaultValue(SQLType<?> sqlType)
getSqlDefaultValue in interface DbmsgetSqlDefaultValue in class AnsiStandardsqlType - the type nameAnsiStandard.getSqlDefaultValue(org.melati.poem.SQLType)public String getQuotedValue(SQLType<?> sqlType, String value)
DbmsgetQuotedValue in interface DbmsgetQuotedValue in class AnsiStandardsqlType - the SQLType of the valuevalue - the valueCopyright © 2000–2021 PanEris. All rights reserved.