org.objectweb.jorm.mapper.rdb.adapter
Class SqlserverAdapter

java.lang.Object
  extended byorg.objectweb.jorm.mapper.rdb.adapter.BasicRdbAdapter
      extended byorg.objectweb.jorm.mapper.rdb.adapter.SqlserverAdapter
All Implemented Interfaces:
PreparedStatementAdapter, RdbAdapter, ResultsetAdapter, SequenceAdapter, TypeAdapter, ValueAsSQLStringAdapter

public class SqlserverAdapter
extends BasicRdbAdapter

This class is a sql adapter for the SQL Server relational database.

Author:
P. Dechamboux

Field Summary
 
Fields inherited from class org.objectweb.jorm.mapper.rdb.adapter.BasicRdbAdapter
logger, name
 
Fields inherited from interface org.objectweb.jorm.mapper.rdb.adapter.api.RdbAdapter
NOSIZE, RANGEATEND, RANGEATSTART, RANGEUNSUPPORTED
 
Fields inherited from interface org.objectweb.jorm.mapper.rdb.adapter.api.TypeAdapter
TYPE_NAMES, TYPECODE_ARRAY, TYPECODE_BIGDECIMAL, TYPECODE_BIGINTEGER, TYPECODE_BOOLEAN, TYPECODE_BYTE, TYPECODE_BYTEARRAY, TYPECODE_CHAR, TYPECODE_CHARARRAY, TYPECODE_DATE, TYPECODE_DOUBLE, TYPECODE_FLOAT, TYPECODE_INT, TYPECODE_LONG, TYPECODE_OBJBOOLEAN, TYPECODE_OBJBYTE, TYPECODE_OBJCHAR, TYPECODE_OBJDOUBLE, TYPECODE_OBJFLOAT, TYPECODE_OBJINT, TYPECODE_OBJLONG, TYPECODE_OBJSHORT, TYPECODE_SERIALIZED, TYPECODE_SHORT, TYPECODE_STRING
 
Constructor Summary
SqlserverAdapter()
           
 
Method Summary
 char[] getCharArray(java.sql.ResultSet rs, int idx, char[] nullValue)
          Get a char[] value from a ResultSet.
 java.lang.String getCreateSequence(java.lang.String seqName)
           
 java.lang.String getCreateSequence(java.lang.String seqName, java.lang.Integer startid, java.lang.Integer inc, java.lang.Integer cache)
          CREATE [ TEMPORARY | TEMP ] SEQUENCE name [ INCREMENT [ BY ] increment ] [ MINVALUE minvalue | NO MINVALUE ] [ MAXVALUE maxvalue | NO MAXVALUE ] [ START [ WITH ] start ] [ CACHE cache ] [ [ NO ] CYCLE ]
 java.lang.String getLengthOperator()
           
 java.lang.String getSqlType(int typeCode, boolean usedInPK, int size, int scale)
          This method returns the SQL type linked to the java type
 void setCharArray(java.sql.PreparedStatement ps, int idx, char[] o)
          Assignes a char[] value into a PreparedStatement
 void setObyte(java.sql.PreparedStatement ps, int idx, java.lang.Byte o)
          Assignes a Byte value into a PreparedStatement
 void setOchar(java.sql.PreparedStatement ps, int idx, java.lang.Character o)
          Assignes a Character value into a PreparedStatement
 
Methods inherited from class org.objectweb.jorm.mapper.rdb.adapter.BasicRdbAdapter
appendClause, escapeFunctionClose, escapeFunctionOpen, existRelation, existSequence, existTable, existView, fetchResultSetSize, getArray, getArrayElementAsSQLString, getArrayToString, getArrayToStringBegin, getArrayToStringEnd, getArrayToStringSeparator, getArrayValueAsSQLString, getArrayValueAsSQLString, getArrayValueAsSQLStringBegin, getArrayValueAsSQLStringEnd, getArrayValueAsSQLStringSeparator, getBigDecimal, getBigInteger, getBoolean, getByte, getByteArray, getCACHEkeyWord, getChar, getCharArray, getColumnAliasExpr, getConcatExpression, getDate, getDate, getDouble, getFirstLocateExpression, getFloat, getFromClause, getFromClause, getFromClause, getINCREMENTkeyWord, getIndexedLocateExpression, getInt, getLong, getManyNextValInSequence, getName, getNextValInSequence, getOboolean, getObyte, getOchar, getOdouble, getOfloat, getOint, getOlong, getOshort, getQuery, getQuery, getRangeParametersAtStart, getSerialized, getShort, getSqlTypeCode, getSqlTypeCode, getSTARTkeyWord, getString, getSubqueryAlias, getValueAsSQLString, getValueAsSQLString, getValueAsSQLString, getValueAsSQLString, getValueAsSQLString, getValueAsSQLString, getValueAsSQLString, getValueAsSQLString, getValueAsSQLString, handleOrderBy, modifyQueryWithRange, modifySelectClauseWithRange, setArray, setBigDecimal, setBigInteger, setBoolean, setByte, setByteArray, setChar, setDate, setDouble, setFloat, setInt, setLogger, setLong, setNull, setOboolean, setOdouble, setOfloat, setOint, setOlong, setOshort, setSerialized, setShort, setString, supportArray, supportBatchPreparedStatement, writeColumnAlias, writeTableAlias
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SqlserverAdapter

public SqlserverAdapter()
Method Detail

getSqlType

public java.lang.String getSqlType(int typeCode,
                                   boolean usedInPK,
                                   int size,
                                   int scale)
                            throws RdbAdapterException
Description copied from interface: TypeAdapter
This method returns the SQL type linked to the java type

Specified by:
getSqlType in interface TypeAdapter
Overrides:
getSqlType in class BasicRdbAdapter
Throws:
RdbAdapterException

getCharArray

public char[] getCharArray(java.sql.ResultSet rs,
                           int idx,
                           char[] nullValue)
                    throws java.sql.SQLException
Description copied from interface: ResultsetAdapter
Get a char[] value from a ResultSet.

Specified by:
getCharArray in interface ResultsetAdapter
Overrides:
getCharArray in class BasicRdbAdapter
Throws:
java.sql.SQLException

setObyte

public void setObyte(java.sql.PreparedStatement ps,
                     int idx,
                     java.lang.Byte o)
              throws java.sql.SQLException
Description copied from interface: PreparedStatementAdapter
Assignes a Byte value into a PreparedStatement

Specified by:
setObyte in interface PreparedStatementAdapter
Overrides:
setObyte in class BasicRdbAdapter
Throws:
java.sql.SQLException

setOchar

public void setOchar(java.sql.PreparedStatement ps,
                     int idx,
                     java.lang.Character o)
              throws java.sql.SQLException
Description copied from interface: PreparedStatementAdapter
Assignes a Character value into a PreparedStatement

Specified by:
setOchar in interface PreparedStatementAdapter
Overrides:
setOchar in class BasicRdbAdapter
Throws:
java.sql.SQLException

setCharArray

public void setCharArray(java.sql.PreparedStatement ps,
                         int idx,
                         char[] o)
                  throws java.sql.SQLException
Description copied from interface: PreparedStatementAdapter
Assignes a char[] value into a PreparedStatement

Specified by:
setCharArray in interface PreparedStatementAdapter
Overrides:
setCharArray in class BasicRdbAdapter
Throws:
java.sql.SQLException

getCreateSequence

public java.lang.String getCreateSequence(java.lang.String seqName)
                                   throws java.lang.UnsupportedOperationException
Specified by:
getCreateSequence in interface SequenceAdapter
Overrides:
getCreateSequence in class BasicRdbAdapter
Throws:
java.lang.UnsupportedOperationException

getCreateSequence

public java.lang.String getCreateSequence(java.lang.String seqName,
                                          java.lang.Integer startid,
                                          java.lang.Integer inc,
                                          java.lang.Integer cache)
Description copied from class: BasicRdbAdapter
CREATE [ TEMPORARY | TEMP ] SEQUENCE name [ INCREMENT [ BY ] increment ] [ MINVALUE minvalue | NO MINVALUE ] [ MAXVALUE maxvalue | NO MAXVALUE ] [ START [ WITH ] start ] [ CACHE cache ] [ [ NO ] CYCLE ]

Specified by:
getCreateSequence in interface SequenceAdapter
Overrides:
getCreateSequence in class BasicRdbAdapter
Parameters:
seqName -
startid -
inc -

getLengthOperator

public java.lang.String getLengthOperator()
                                   throws RdbAdapterException
Specified by:
getLengthOperator in interface RdbAdapter
Overrides:
getLengthOperator in class BasicRdbAdapter
Throws:
RdbAdapterException