|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectorg.melati.poem.dbms.AnsiStandard
org.melati.poem.dbms.SQLServer
public class SQLServer
A Driver for the Microsoft SQL server.
| Nested Class Summary | |
|---|---|
static class |
SQLServer.SQLServerBooleanPoemType
Translates an SQLServer Boolean into a Poem BooleanPoemType. |
| Field Summary | |
|---|---|
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. |
| Fields inherited from class org.melati.poem.dbms.AnsiStandard |
|---|
schema |
| Constructor Summary | |
|---|---|
SQLServer()
Constructor. |
|
| Method Summary | |
|---|---|
String |
alterColumnNotNullableSQL(String tableName,
Column column)
Accommodate SQLServer syntax. |
String |
booleanTrueExpression(Column booleanColumn)
Accomodate lack of boolean types. |
boolean |
canBeIndexed(Column column)
MSSQL cannot index TEXT fields. |
PoemType |
canRepresent(PoemType storage,
PoemType 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)
Accomodate 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()
Accomodate Long / Bigint deviants. |
String |
getQuotedValue(SQLType sqlType,
String value)
Accomodate 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)
Accomodate 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)
Accomodate different limiting syntax. |
String |
sqlBooleanValueOfRaw(Object raw)
Accomodate different true and false values. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int sqlServerTextHack
TEXT datatype, so we use
an arbetary value in a VARCHAR.
public static final int sqlServerMaxBinarySize
| Constructor Detail |
|---|
public SQLServer()
| Method Detail |
|---|
public String getSchema()
getSchema in interface DbmsgetSchema in class AnsiStandardDbms.getSchema(),
AnsiStandard.getSchema(),
org.melati.poem.dbms.Ansistandard#getConnection()public String getSqlDefinition(String sqlTypeName)
getSqlDefinition in interface DbmsgetSqlDefinition in class AnsiStandardsqlTypeName - the Melati internal type name
AnsiStandard.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 PoemType canRepresent(PoemType storage,
PoemType type)
canRepresent in interface DbmscanRepresent in class AnsiStandardstorage - the POEM native typetype - the current type
AnsiStandard.canRepresent(org.melati.poem.PoemType>, org.melati.poem.PoemType>)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 is
SQLExceptionDbms.getBinarySqlDefinition(int)
public SQLPoemType defaultPoemTypeOfColumnMetaData(ResultSet md)
throws SQLException
defaultPoemTypeOfColumnMetaData in interface DbmsdefaultPoemTypeOfColumnMetaData in class AnsiStandardmd - the JDBC metadata
SQLException - potentiallyAnsiStandard.defaultPoemTypeOfColumnMetaData(
java.sql.ResultSet)public String melatiName(String name)
melatiName in interface DbmsmelatiName in class AnsiStandardname - an SQL name
AnsiStandard.melatiName(java.lang.String)public boolean canBeIndexed(Column column)
canBeIndexed in interface DbmscanBeIndexed in class AnsiStandardcolumn - the POEM Column we are dealing with
Dbms.canBeIndexed(org.melati.poem.Column)
public String caseInsensitiveRegExpSQL(String term1,
String term2)
caseInsensitiveRegExpSQL in interface DbmscaseInsensitiveRegExpSQL in class AnsiStandardterm1 - the term to find interm2 - the quoted term to find
AnsiStandard.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 IntegrityFix
AnsiStandard.getForeignKeyDefinition(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
public String alterColumnNotNullableSQL(String tableName,
Column column)
alterColumnNotNullableSQL in interface DbmsalterColumnNotNullableSQL in class AnsiStandardalterColumnNotNullableSQL(java.lang.String,
java.lang.String)
public String selectLimit(String querySelection,
int limit)
selectLimit in interface DbmsselectLimit in class AnsiStandardquerySelection - main body of querylimit - number to limit to
Dbms.selectLimit(java.lang.String, int)public String booleanTrueExpression(Column booleanColumn)
booleanTrueExpression in interface DbmsbooleanTrueExpression in class AnsiStandardDbms.booleanTrueExpression(org.melati.poem.Column)public String getSqlDefaultValue(SQLType sqlType)
getSqlDefaultValue in interface DbmsgetSqlDefaultValue in class AnsiStandardsqlType - the type name
AnsiStandard.getSqlDefaultValue(org.melati.poem.SQLType)
public String getQuotedValue(SQLType sqlType,
String value)
getQuotedValue in interface DbmsgetQuotedValue in class AnsiStandardsqlType - the SQLType of the valuevalue - the value
org.melati.poem.dbms.Dbms#getQuotedValue(org.melati.poem.SQLType, java.lang.Object)
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||