|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 Dbms
getSchema
in class AnsiStandard
Dbms.getSchema()
,
AnsiStandard.getSchema()
,
org.melati.poem.dbms.Ansistandard#getConnection()
public String getSqlDefinition(String sqlTypeName)
getSqlDefinition
in interface Dbms
getSqlDefinition
in class AnsiStandard
sqlTypeName
- the Melati internal type name
AnsiStandard.getSqlDefinition(java.lang.String)
public String getStringSqlDefinition(int size) throws SQLException
getStringSqlDefinition
in interface Dbms
getStringSqlDefinition
in class AnsiStandard
size
- the string length (-1 means no limit)
SQLException
AnsiStandard.getStringSqlDefinition(int)
public PoemType canRepresent(PoemType storage, PoemType type)
canRepresent
in interface Dbms
canRepresent
in class AnsiStandard
storage
- 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 Dbms
sqlBooleanValueOfRaw
in class AnsiStandard
AnsiStandard.sqlBooleanValueOfRaw(java.lang.Object)
public String getLongSqlDefinition()
getLongSqlDefinition
in interface Dbms
getLongSqlDefinition
in class AnsiStandard
Dbms.getLongSqlDefinition()
public String getBinarySqlDefinition(int size) throws SQLException
getBinarySqlDefinition
in interface Dbms
getBinarySqlDefinition
in class AnsiStandard
size
- how big the field is
SQLException
Dbms.getBinarySqlDefinition(int)
public SQLPoemType defaultPoemTypeOfColumnMetaData(ResultSet md) throws SQLException
defaultPoemTypeOfColumnMetaData
in interface Dbms
defaultPoemTypeOfColumnMetaData
in class AnsiStandard
md
- the JDBC metadata
SQLException
- potentiallyAnsiStandard.defaultPoemTypeOfColumnMetaData(
java.sql.ResultSet)
public String melatiName(String name)
melatiName
in interface Dbms
melatiName
in class AnsiStandard
name
- an SQL name
AnsiStandard.melatiName(java.lang.String)
public boolean canBeIndexed(Column column)
canBeIndexed
in interface Dbms
canBeIndexed
in class AnsiStandard
column
- the POEM Column we are dealing with
Dbms.canBeIndexed(org.melati.poem.Column)
public String caseInsensitiveRegExpSQL(String term1, String term2)
caseInsensitiveRegExpSQL
in interface Dbms
caseInsensitiveRegExpSQL
in class AnsiStandard
term1
- 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 Dbms
getForeignKeyDefinition
in class AnsiStandard
tableName
- 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 Dbms
alterColumnNotNullableSQL
in class AnsiStandard
alterColumnNotNullableSQL(java.lang.String,
java.lang.String)
public String selectLimit(String querySelection, int limit)
selectLimit
in interface Dbms
selectLimit
in class AnsiStandard
querySelection
- main body of querylimit
- number to limit to
Dbms.selectLimit(java.lang.String, int)
public String booleanTrueExpression(Column booleanColumn)
booleanTrueExpression
in interface Dbms
booleanTrueExpression
in class AnsiStandard
Dbms.booleanTrueExpression(org.melati.poem.Column)
public String getSqlDefaultValue(SQLType sqlType)
getSqlDefaultValue
in interface Dbms
getSqlDefaultValue
in class AnsiStandard
sqlType
- the type name
AnsiStandard.getSqlDefaultValue(org.melati.poem.SQLType)
public String getQuotedValue(SQLType sqlType, String value)
getQuotedValue
in interface Dbms
getQuotedValue
in class AnsiStandard
sqlType
- 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 |