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

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

public class FirebirdAdapter
extends BasicRdbAdapter

This class is a sql adapter for the Firebird 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
FirebirdAdapter()
           
 
Method Summary
 boolean getBoolean(java.sql.ResultSet rs, int idx, boolean nullValue)
          Get a boolean value from a ResultSet.
 java.lang.Boolean getOboolean(java.sql.ResultSet rs, int idx, java.lang.Boolean nullValue)
          Get a Boolean value from a ResultSet.
 java.lang.String getSqlType(int typeCode, boolean usedInPK, int size, int scale)
          This method returns the SQL type linked to the java type
 void setBoolean(java.sql.PreparedStatement ps, int idx, boolean o)
          Assignes a boolean value into a PreparedStatement
 void setOboolean(java.sql.PreparedStatement ps, int idx, java.lang.Boolean o)
          Assignes a Boolean value into a PreparedStatement
 void setOchar(java.sql.PreparedStatement ps, int idx, java.lang.Character o)
          Assignes a Character value into a PreparedStatement
 boolean supportBatchPreparedStatement()
          Indicates if the driver supports the batch of PreparedStatement
 void writeTableAlias(java.lang.String alias, java.lang.StringBuffer sb)
          Append a table alias to an SQL expression.
 
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, getByte, getByteArray, getCACHEkeyWord, getChar, getCharArray, getCharArray, getColumnAliasExpr, getConcatExpression, getCreateSequence, getCreateSequence, getDate, getDate, getDouble, getFirstLocateExpression, getFloat, getFromClause, getFromClause, getFromClause, getINCREMENTkeyWord, getIndexedLocateExpression, getInt, getLengthOperator, getLong, getManyNextValInSequence, getName, getNextValInSequence, 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, setByte, setByteArray, setChar, setCharArray, setDate, setDouble, setFloat, setInt, setLogger, setLong, setNull, setObyte, setOdouble, setOfloat, setOint, setOlong, setOshort, setSerialized, setShort, setString, supportArray, writeColumnAlias
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FirebirdAdapter

public FirebirdAdapter()
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
Parameters:
typeCode - is the type code of the java type
usedInPK - indicates if the type has to be used into a Primary key
size - can indicates the expected size of the type. If it equals to NO_SIZE that means no size is expected. This parameter can be used for float, BigXXX numbers, String,...
scale - can indicates the expected scale of the type. If it equals to NO_SIZE that means no scale is expected.
Throws:
RdbAdapterException

getBoolean

public boolean getBoolean(java.sql.ResultSet rs,
                          int idx,
                          boolean nullValue)
                   throws java.sql.SQLException
Description copied from interface: ResultsetAdapter
Get a boolean value from a ResultSet.

Specified by:
getBoolean in interface ResultsetAdapter
Overrides:
getBoolean in class BasicRdbAdapter
Parameters:
rs - is the result where to get the value
idx - is the index of the value in the resultset
nullValue - represents the nullvalue to return if the column is null in the resultset
Throws:
java.sql.SQLException

getOboolean

public java.lang.Boolean getOboolean(java.sql.ResultSet rs,
                                     int idx,
                                     java.lang.Boolean nullValue)
                              throws java.sql.SQLException
Description copied from interface: ResultsetAdapter
Get a Boolean value from a ResultSet.

Specified by:
getOboolean in interface ResultsetAdapter
Overrides:
getOboolean in class BasicRdbAdapter
Parameters:
rs - is the result where to get the value
idx - is the index of the value in the resultset
nullValue - represents the nullvalue to return if the column is null in the resultset
Throws:
java.sql.SQLException

setBoolean

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

Specified by:
setBoolean in interface PreparedStatementAdapter
Overrides:
setBoolean in class BasicRdbAdapter
Parameters:
ps - is the PreparedStatement
idx - is the index of the the value in the PreparedStatement
o - is the value to assign
Throws:
java.sql.SQLException

setOboolean

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

Specified by:
setOboolean in interface PreparedStatementAdapter
Overrides:
setOboolean in class BasicRdbAdapter
Parameters:
ps - is the PreparedStatement
idx - is the index of the the value in the PreparedStatement
o - is the value to assign
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
Parameters:
ps - is the PreparedStatement
idx - is the index of the the value in the PreparedStatement
o - is the value to assign
Throws:
java.sql.SQLException

writeTableAlias

public void writeTableAlias(java.lang.String alias,
                            java.lang.StringBuffer sb)
Description copied from interface: RdbAdapter
Append a table alias to an SQL expression. To be used when constructing the string expression of a from clause. For example, most database recognize the syntax 'select ... from R as ALIAS_FOR_R, S as ALIAS_FOR_S ... ' whereas Orabcle accepts the following syntax : 'select ... from R ALIAS_FOR_R, S ALIAS_FOR_S ... '

Specified by:
writeTableAlias in interface RdbAdapter
Overrides:
writeTableAlias in class BasicRdbAdapter
Parameters:
alias - The table alias
sb - The StringBuffer into which to write the alias.

supportBatchPreparedStatement

public boolean supportBatchPreparedStatement()
Description copied from interface: RdbAdapter
Indicates if the driver supports the batch of PreparedStatement

Specified by:
supportBatchPreparedStatement in interface RdbAdapter
Overrides:
supportBatchPreparedStatement in class BasicRdbAdapter