|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.jorm.mapper.rdb.adapter.BasicRdbAdapter
Field Summary | |
private static boolean |
accountForNanos
|
private static java.lang.String |
CONCAT
|
private static java.lang.String |
INDEXEDLOCATE
|
protected Logger |
logger
|
protected java.lang.String |
name
Is the name of the RdbAdapter. |
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 | |
BasicRdbAdapter()
|
|
BasicRdbAdapter(java.lang.String _name)
|
Method Summary | |
protected void |
appendClause(java.lang.StringBuffer sb,
java.lang.String clause,
java.lang.String value)
|
void |
escapeFunctionClose(java.lang.StringBuffer sb)
Modifies the end of a function expression for the escape syntax. |
void |
escapeFunctionOpen(java.lang.StringBuffer sb)
Modifies the start of a function expression for the escape syntax. |
protected boolean |
existRelation(java.sql.Connection connection,
java.lang.String relName,
java.lang.String[] relationTypes)
|
boolean |
existSequence(java.sql.Connection connection,
java.lang.String seqName)
checks the sequence existence |
boolean |
existTable(java.sql.Connection connection,
java.lang.String tableName)
checks the table existence |
boolean |
existView(java.sql.Connection connection,
java.lang.String viewName)
checks the view existence |
int |
fetchResultSetSize(java.sql.ResultSet rs)
This calculates the size of a result set. |
java.lang.Object |
getArray(java.sql.ResultSet rs,
int idx,
java.lang.Object nullValue,
int typeCode)
Get an array value from a ResultSet. |
java.lang.String |
getArrayElementAsSQLString(java.lang.Object elem,
int elemTypeCode)
|
java.lang.String |
getArrayToString(java.lang.Object array,
int typeCode)
|
java.lang.String |
getArrayToStringBegin()
|
java.lang.String |
getArrayToStringEnd()
|
java.lang.String |
getArrayToStringSeparator()
|
java.lang.String |
getArrayValueAsSQLString(java.lang.Object array,
int typeCode)
|
java.lang.String |
getArrayValueAsSQLString(java.lang.Object array,
int typeCode,
java.lang.String begin,
java.lang.String realsep,
java.lang.String end)
|
java.lang.String |
getArrayValueAsSQLStringBegin()
|
java.lang.String |
getArrayValueAsSQLStringEnd()
|
java.lang.String |
getArrayValueAsSQLStringSeparator()
|
java.math.BigDecimal |
getBigDecimal(java.sql.ResultSet rs,
int idx,
java.math.BigDecimal nullValue)
Get a BigDecimal value from a ResultSet. |
java.math.BigInteger |
getBigInteger(java.sql.ResultSet rs,
int idx,
java.math.BigInteger nullValue)
Get a BigInteger value from a ResultSet. |
boolean |
getBoolean(java.sql.ResultSet rs,
int idx,
boolean nullValue)
Get a boolean value from a ResultSet. |
byte |
getByte(java.sql.ResultSet rs,
int idx,
byte nullValue)
Get a byte value from a ResultSet. |
byte[] |
getByteArray(java.sql.ResultSet rs,
int idx,
byte[] nullValue)
Get a byte[] value from a ResultSet. |
protected java.lang.String |
getCACHEkeyWord()
|
char |
getChar(java.sql.ResultSet rs,
int idx,
char nullValue)
Get a char value from a ResultSet. |
static char[] |
getCharArray(java.lang.Object o)
|
private static char[] |
getCharArray(java.io.Reader reader)
|
char[] |
getCharArray(java.sql.ResultSet rs,
int idx,
char[] nullValue)
Get a char[] value from a ResultSet. |
java.lang.String |
getColumnAliasExpr(java.lang.String aliasName)
Returns a column alias expression. |
java.lang.String |
getConcatExpression(java.lang.String op1,
java.lang.String op2)
|
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.util.Date |
getDate(java.sql.ResultSet rs,
int idx,
java.util.Date nullValue)
Get a Date value from a ResultSet. |
java.util.Date |
getDate(java.sql.ResultSet rs,
int idx,
java.lang.String sqlColumnType,
java.util.Date nullValue)
Get a Date value from a ResultSet. |
double |
getDouble(java.sql.ResultSet rs,
int idx,
double nullValue)
Get a double value from a ResultSet. |
java.lang.String |
getFirstLocateExpression(java.lang.String substring,
java.lang.String instring)
Returns the expression for searching the position of the first occurrence of a substring in a string. |
float |
getFloat(java.sql.ResultSet rs,
int idx,
float nullValue)
Get a float value from a ResultSet. |
protected void |
getFromClause(JoinedTable jtMain,
JoinedTable jt,
JoinedTable.Join join,
java.lang.StringBuffer sb)
|
protected void |
getFromClause(JoinedTable jt,
java.lang.StringBuffer sb)
|
java.lang.String |
getFromClause(java.util.List jts)
Builds a from clause from a list of JoinedTable objects. |
protected java.lang.String |
getINCREMENTkeyWord()
|
java.lang.String |
getIndexedLocateExpression(java.lang.String instring,
java.lang.String substring,
java.lang.String fromIndex)
Returns the expression for searching the position of the first occurrence of a substring in a string starting from a given index. |
int |
getInt(java.sql.ResultSet rs,
int idx,
int nullValue)
Get a int value from a ResultSet. |
java.lang.String |
getLengthOperator()
|
long |
getLong(java.sql.ResultSet rs,
int idx,
long nullValue)
Get a long value from a ResultSet. |
void |
getManyNextValInSequence(java.sql.Connection conn,
java.lang.String seqName,
int numberOfNextVal)
|
java.lang.String |
getName()
|
java.lang.String |
getNextValInSequence(java.lang.String seqName)
|
java.lang.Boolean |
getOboolean(java.sql.ResultSet rs,
int idx,
java.lang.Boolean nullValue)
Get a Boolean value from a ResultSet. |
java.lang.Byte |
getObyte(java.sql.ResultSet rs,
int idx,
java.lang.Byte nullValue)
Get a Byte value from a ResultSet. |
java.lang.Character |
getOchar(java.sql.ResultSet rs,
int idx,
java.lang.Character nullValue)
Get a Character value from a ResultSet. |
java.lang.Double |
getOdouble(java.sql.ResultSet rs,
int idx,
java.lang.Double nullValue)
Get a Double value from a ResultSet. |
java.lang.Float |
getOfloat(java.sql.ResultSet rs,
int idx,
java.lang.Float nullValue)
Get a Float value from a ResultSet. |
java.lang.Integer |
getOint(java.sql.ResultSet rs,
int idx,
java.lang.Integer nullValue)
Get a Integer value from a ResultSet. |
java.lang.Long |
getOlong(java.sql.ResultSet rs,
int idx,
java.lang.Long nullValue)
Get a Long value from a ResultSet. |
java.lang.Short |
getOshort(java.sql.ResultSet rs,
int idx,
java.lang.Short nullValue)
Get a Short value from a ResultSet. |
java.lang.String |
getQuery(java.lang.String selectClause,
java.util.List jts,
java.lang.String whereClause,
boolean rangeStart,
boolean rangeSize)
Builds a query with join and table alias. |
java.lang.String |
getQuery(java.lang.String selectClause,
java.lang.String fromClause,
java.lang.String whereClause,
java.lang.String orderBy,
java.lang.String groupBy,
boolean rangeStart,
boolean rangeSize)
Builds a query with join and table alias. |
int |
getRangeParametersAtStart()
Indicates whether parameters corresponding to range queries (range start and size) are positioned at the start or at the end of the SQL query. |
java.io.Serializable |
getSerialized(java.sql.ResultSet rs,
int idx,
java.io.Serializable nullValue)
Get a Serializable value from a ResultSet. |
short |
getShort(java.sql.ResultSet rs,
int idx,
short nullValue)
Get a short 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 |
int |
getSqlTypeCode(int typeCode)
This methods return the SQL type code linked to the java type specified in parameter. |
int |
getSqlTypeCode(int typeCode,
java.lang.String sqlColumnType)
This methods return the SQL type code linked to the java type specified in parameter. |
protected java.lang.String |
getSTARTkeyWord()
|
java.lang.String |
getString(java.sql.ResultSet rs,
int idx,
java.lang.String nullValue)
Get a String value from a ResultSet. |
java.lang.String |
getSubqueryAlias()
In the case the subquery needs to be aliased (Postgres), returns a string to be appended to the subquery. |
java.lang.String |
getValueAsSQLString(boolean value)
This method returns a String value that represents a boolean value. |
java.lang.String |
getValueAsSQLString(byte value)
This method returns a String value that represents a byte value. |
java.lang.String |
getValueAsSQLString(char value)
This method returns a String value that represents a char value. |
java.lang.String |
getValueAsSQLString(double value)
This method returns a String value that represents a double value. |
java.lang.String |
getValueAsSQLString(float value)
This method returns a String value that represents a float value. |
java.lang.String |
getValueAsSQLString(int value)
This method returns a String value that represents a int value. |
java.lang.String |
getValueAsSQLString(long value)
This method returns a String value that represents a long value. |
java.lang.String |
getValueAsSQLString(java.lang.Object value,
int typeCode)
This method returns a String value that represents a value. |
java.lang.String |
getValueAsSQLString(short value)
This method returns a String value that represents a short value. |
java.lang.String |
handleOrderBy(java.lang.String query)
|
protected void |
modifyQueryWithRange(java.lang.StringBuffer sb,
boolean rangeStart,
boolean rangeSize)
|
protected void |
modifySelectClauseWithRange(java.lang.StringBuffer sb,
boolean rangeStart,
boolean rangeSize)
|
void |
setArray(java.sql.PreparedStatement ps,
int idx,
java.lang.Object o,
int typeCode)
Assignes an array value into a PreparedStatement |
void |
setBigDecimal(java.sql.PreparedStatement ps,
int idx,
java.math.BigDecimal o)
Assignes a BigDecimal value into a PreparedStatement |
void |
setBigInteger(java.sql.PreparedStatement ps,
int idx,
java.math.BigInteger o)
Assignes a BigInteger value into a PreparedStatement |
void |
setBoolean(java.sql.PreparedStatement ps,
int idx,
boolean o)
Assignes a boolean value into a PreparedStatement |
void |
setByte(java.sql.PreparedStatement ps,
int idx,
byte o)
Assignes a byte value into a PreparedStatement |
void |
setByteArray(java.sql.PreparedStatement ps,
int idx,
byte[] o)
Assignes a byte[] value into a PreparedStatement |
void |
setChar(java.sql.PreparedStatement ps,
int idx,
char c)
Assignes a char value into a PreparedStatement |
void |
setCharArray(java.sql.PreparedStatement ps,
int idx,
char[] o)
Assignes a char[] value into a PreparedStatement |
void |
setDate(java.sql.PreparedStatement ps,
int idx,
java.util.Date o,
java.lang.String columnType)
Assignes a String value into a PreparedStatement |
void |
setDouble(java.sql.PreparedStatement ps,
int idx,
double o)
Assignes a double value into a PreparedStatement |
void |
setFloat(java.sql.PreparedStatement ps,
int idx,
float o)
Assignes a float value into a PreparedStatement |
void |
setInt(java.sql.PreparedStatement ps,
int idx,
int o)
Assignes an int value into a PreparedStatement |
void |
setLogger(Logger _logger)
Sets the corresponding Monolog logger. |
void |
setLong(java.sql.PreparedStatement ps,
int idx,
long o)
Assignes a long value into a PreparedStatement |
void |
setNull(java.sql.PreparedStatement ps,
int idx,
int sqlType)
Assignes a null value into a PreparedStatement |
void |
setOboolean(java.sql.PreparedStatement ps,
int idx,
java.lang.Boolean o)
Assignes a Boolean 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 |
void |
setOdouble(java.sql.PreparedStatement ps,
int idx,
java.lang.Double o)
Assignes a Double value into a PreparedStatement |
void |
setOfloat(java.sql.PreparedStatement ps,
int idx,
java.lang.Float o)
Assignes a Float value into a PreparedStatement |
void |
setOint(java.sql.PreparedStatement ps,
int idx,
java.lang.Integer o)
Assignes an Integer value into a PreparedStatement |
void |
setOlong(java.sql.PreparedStatement ps,
int idx,
java.lang.Long o)
Assignes a Long value into a PreparedStatement |
void |
setOshort(java.sql.PreparedStatement ps,
int idx,
java.lang.Short o)
Assignes a Short value into a PreparedStatement |
void |
setSerialized(java.sql.PreparedStatement ps,
int idx,
java.io.Serializable o)
Assignes a serializable value into a PreparedStatement |
void |
setShort(java.sql.PreparedStatement ps,
int idx,
short o)
Assignes a short value into a PreparedStatement |
void |
setString(java.sql.PreparedStatement ps,
int idx,
java.lang.String o)
Assignes a value into a PreparedStatement |
private static java.util.Date |
sqldate2date(java.sql.Date d)
|
boolean |
supportArray(int elemTypeCode)
|
boolean |
supportBatchPreparedStatement()
Indicates if the driver supports the batch of PreparedStatement |
private static java.util.Date |
time2date(java.sql.Time t)
|
private static java.util.Date |
timestamp2date(java.sql.Timestamp tstamp)
|
void |
writeColumnAlias(java.lang.String alias,
java.lang.StringBuffer sb)
Append a column alias to an SQL expression. |
void |
writeTableAlias(java.lang.String alias,
java.lang.StringBuffer sb)
Append a table alias to an SQL expression. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final java.lang.String CONCAT
private static final java.lang.String INDEXEDLOCATE
protected Logger logger
protected java.lang.String name
private static final boolean accountForNanos
Constructor Detail |
public BasicRdbAdapter()
public BasicRdbAdapter(java.lang.String _name)
Method Detail |
public boolean supportBatchPreparedStatement()
RdbAdapter
supportBatchPreparedStatement
in interface RdbAdapter
public java.lang.String getName()
getName
in interface RdbAdapter
public int getSqlTypeCode(int typeCode) throws RdbAdapterException
getSqlTypeCode
in interface TypeAdapter
RdbAdapterException
public int getSqlTypeCode(int typeCode, java.lang.String sqlColumnType) throws RdbAdapterException
getSqlTypeCode
in interface TypeAdapter
RdbAdapterException
public java.lang.String getSqlType(int typeCode, boolean usedInPK, int size, int scale) throws RdbAdapterException
TypeAdapter
getSqlType
in interface TypeAdapter
typeCode
- is the type code of the java typeusedInPK
- indicates if the type has to be used into a Primary keysize
- 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.
RdbAdapterException
public void setNull(java.sql.PreparedStatement ps, int idx, int sqlType) throws java.sql.SQLException
PreparedStatementAdapter
setNull
in interface PreparedStatementAdapter
ps
- is the PreparedStatementidx
- is the index of the the value in the PreparedStatementsqlType
- is the type of the column
java.sql.SQLException
public int fetchResultSetSize(java.sql.ResultSet rs) throws java.sql.SQLException
fetchResultSetSize
in interface RdbAdapter
rs
- the result set which the size must be returned
java.sql.SQLException
public java.lang.String getValueAsSQLString(java.lang.Object value, int typeCode)
ValueAsSQLStringAdapter
getValueAsSQLString
in interface ValueAsSQLStringAdapter
value
- typeCode
- is the java type of the valuepublic java.lang.String getArrayToStringBegin()
public java.lang.String getArrayToStringEnd()
public java.lang.String getArrayToStringSeparator()
public java.lang.String getArrayToString(java.lang.Object array, int typeCode)
getArrayToString
in interface PreparedStatementAdapter
public java.lang.String getArrayValueAsSQLStringBegin()
public java.lang.String getArrayValueAsSQLStringEnd()
public java.lang.String getArrayValueAsSQLStringSeparator()
public java.lang.String getArrayElementAsSQLString(java.lang.Object elem, int elemTypeCode)
public java.lang.String getArrayValueAsSQLString(java.lang.Object array, int typeCode)
public java.lang.String getArrayValueAsSQLString(java.lang.Object array, int typeCode, java.lang.String begin, java.lang.String realsep, java.lang.String end)
public java.lang.String getValueAsSQLString(boolean value)
ValueAsSQLStringAdapter
getValueAsSQLString
in interface ValueAsSQLStringAdapter
public java.lang.String getValueAsSQLString(byte value)
ValueAsSQLStringAdapter
getValueAsSQLString
in interface ValueAsSQLStringAdapter
public java.lang.String getValueAsSQLString(char value)
ValueAsSQLStringAdapter
getValueAsSQLString
in interface ValueAsSQLStringAdapter
public java.lang.String getValueAsSQLString(short value)
ValueAsSQLStringAdapter
getValueAsSQLString
in interface ValueAsSQLStringAdapter
public java.lang.String getValueAsSQLString(int value)
ValueAsSQLStringAdapter
getValueAsSQLString
in interface ValueAsSQLStringAdapter
public java.lang.String getValueAsSQLString(long value)
ValueAsSQLStringAdapter
getValueAsSQLString
in interface ValueAsSQLStringAdapter
public java.lang.String getValueAsSQLString(float value)
ValueAsSQLStringAdapter
getValueAsSQLString
in interface ValueAsSQLStringAdapter
public java.lang.String getValueAsSQLString(double value)
ValueAsSQLStringAdapter
getValueAsSQLString
in interface ValueAsSQLStringAdapter
public boolean getBoolean(java.sql.ResultSet rs, int idx, boolean nullValue) throws java.sql.SQLException
ResultsetAdapter
getBoolean
in interface ResultsetAdapter
rs
- is the result where to get the valueidx
- is the index of the value in the resultsetnullValue
- represents the nullvalue to return if the column is null
in the resultset
java.sql.SQLException
public java.lang.Boolean getOboolean(java.sql.ResultSet rs, int idx, java.lang.Boolean nullValue) throws java.sql.SQLException
ResultsetAdapter
getOboolean
in interface ResultsetAdapter
rs
- is the result where to get the valueidx
- is the index of the value in the resultsetnullValue
- represents the nullvalue to return if the column is null
in the resultset
java.sql.SQLException
public char getChar(java.sql.ResultSet rs, int idx, char nullValue) throws java.sql.SQLException
ResultsetAdapter
getChar
in interface ResultsetAdapter
rs
- is the result where to get the valueidx
- is the index of the value in the resultsetnullValue
- represents the nullvalue to return if the column is null
in the resultset
java.sql.SQLException
public java.lang.Character getOchar(java.sql.ResultSet rs, int idx, java.lang.Character nullValue) throws java.sql.SQLException
ResultsetAdapter
getOchar
in interface ResultsetAdapter
rs
- is the result where to get the valueidx
- is the index of the value in the resultsetnullValue
- represents the nullvalue to return if the column is null
in the resultset
java.sql.SQLException
public byte getByte(java.sql.ResultSet rs, int idx, byte nullValue) throws java.sql.SQLException
ResultsetAdapter
getByte
in interface ResultsetAdapter
rs
- is the result where to get the valueidx
- is the index of the value in the resultsetnullValue
- represents the nullvalue to return if the column is null
in the resultset
java.sql.SQLException
public java.lang.Byte getObyte(java.sql.ResultSet rs, int idx, java.lang.Byte nullValue) throws java.sql.SQLException
ResultsetAdapter
getObyte
in interface ResultsetAdapter
rs
- is the result where to get the valueidx
- is the index of the value in the resultsetnullValue
- represents the nullvalue to return if the column is null
in the resultset
java.sql.SQLException
public short getShort(java.sql.ResultSet rs, int idx, short nullValue) throws java.sql.SQLException
ResultsetAdapter
getShort
in interface ResultsetAdapter
rs
- is the result where to get the valueidx
- is the index of the value in the resultsetnullValue
- represents the nullvalue to return if the column is null
in the resultset
java.sql.SQLException
public java.lang.Short getOshort(java.sql.ResultSet rs, int idx, java.lang.Short nullValue) throws java.sql.SQLException
ResultsetAdapter
getOshort
in interface ResultsetAdapter
rs
- is the result where to get the valueidx
- is the index of the value in the resultsetnullValue
- represents the nullvalue to return if the column is null
in the resultset
java.sql.SQLException
public int getInt(java.sql.ResultSet rs, int idx, int nullValue) throws java.sql.SQLException
ResultsetAdapter
getInt
in interface ResultsetAdapter
rs
- is the result where to get the valueidx
- is the index of the value in the resultsetnullValue
- represents the nullvalue to return if the column is null
in the resultset
java.sql.SQLException
public java.lang.Integer getOint(java.sql.ResultSet rs, int idx, java.lang.Integer nullValue) throws java.sql.SQLException
ResultsetAdapter
getOint
in interface ResultsetAdapter
rs
- is the result where to get the valueidx
- is the index of the value in the resultsetnullValue
- represents the nullvalue to return if the column is null
in the resultset
java.sql.SQLException
public long getLong(java.sql.ResultSet rs, int idx, long nullValue) throws java.sql.SQLException
ResultsetAdapter
getLong
in interface ResultsetAdapter
rs
- is the result where to get the valueidx
- is the index of the value in the resultsetnullValue
- represents the nullvalue to return if the column is null
in the resultset
java.sql.SQLException
public java.lang.Long getOlong(java.sql.ResultSet rs, int idx, java.lang.Long nullValue) throws java.sql.SQLException
ResultsetAdapter
getOlong
in interface ResultsetAdapter
rs
- is the result where to get the valueidx
- is the index of the value in the resultsetnullValue
- represents the nullvalue to return if the column is null
in the resultset
java.sql.SQLException
public float getFloat(java.sql.ResultSet rs, int idx, float nullValue) throws java.sql.SQLException
ResultsetAdapter
getFloat
in interface ResultsetAdapter
rs
- is the result where to get the valueidx
- is the index of the value in the resultsetnullValue
- represents the nullvalue to return if the column is null
in the resultset
java.sql.SQLException
public java.lang.Float getOfloat(java.sql.ResultSet rs, int idx, java.lang.Float nullValue) throws java.sql.SQLException
ResultsetAdapter
getOfloat
in interface ResultsetAdapter
rs
- is the result where to get the valueidx
- is the index of the value in the resultsetnullValue
- represents the nullvalue to return if the column is null
in the resultset
java.sql.SQLException
public double getDouble(java.sql.ResultSet rs, int idx, double nullValue) throws java.sql.SQLException
ResultsetAdapter
getDouble
in interface ResultsetAdapter
rs
- is the result where to get the valueidx
- is the index of the value in the resultsetnullValue
- represents the nullvalue to return if the column is null
in the resultset
java.sql.SQLException
public java.lang.Double getOdouble(java.sql.ResultSet rs, int idx, java.lang.Double nullValue) throws java.sql.SQLException
ResultsetAdapter
getOdouble
in interface ResultsetAdapter
rs
- is the result where to get the valueidx
- is the index of the value in the resultsetnullValue
- represents the nullvalue to return if the column is null
in the resultset
java.sql.SQLException
public java.lang.String getString(java.sql.ResultSet rs, int idx, java.lang.String nullValue) throws java.sql.SQLException
ResultsetAdapter
getString
in interface ResultsetAdapter
rs
- is the result where to get the valueidx
- is the index of the value in the resultsetnullValue
- represents the nullvalue to return if the column is null
in the resultset
java.sql.SQLException
public java.util.Date getDate(java.sql.ResultSet rs, int idx, java.util.Date nullValue) throws java.sql.SQLException
ResultsetAdapter
getDate
in interface ResultsetAdapter
rs
- is the result where to get the valueidx
- is the index of the value in the resultsetnullValue
- represents the nullvalue to return if the column is null
in the resultset
java.sql.SQLException
private static java.util.Date timestamp2date(java.sql.Timestamp tstamp)
private static java.util.Date sqldate2date(java.sql.Date d)
private static java.util.Date time2date(java.sql.Time t)
public java.util.Date getDate(java.sql.ResultSet rs, int idx, java.lang.String sqlColumnType, java.util.Date nullValue) throws java.sql.SQLException
ResultsetAdapter
getDate
in interface ResultsetAdapter
rs
- is the result where to get the valueidx
- is the index of the value in the resultsetnullValue
- represents the nullvalue to return if the column is null
in the resultset
java.sql.SQLException
public char[] getCharArray(java.sql.ResultSet rs, int idx, char[] nullValue) throws java.sql.SQLException
ResultsetAdapter
getCharArray
in interface ResultsetAdapter
rs
- is the result where to get the valueidx
- is the index of the value in the resultsetnullValue
- represents the nullvalue to return if the column is null
in the resultset
java.sql.SQLException
private static char[] getCharArray(java.io.Reader reader) throws java.io.IOException
java.io.IOException
public byte[] getByteArray(java.sql.ResultSet rs, int idx, byte[] nullValue) throws java.sql.SQLException
ResultsetAdapter
getByteArray
in interface ResultsetAdapter
rs
- is the result where to get the valueidx
- is the index of the value in the resultsetnullValue
- represents the nullvalue to return if the column is null
in the resultset
java.sql.SQLException
public java.io.Serializable getSerialized(java.sql.ResultSet rs, int idx, java.io.Serializable nullValue) throws java.sql.SQLException, java.io.IOException, java.lang.ClassNotFoundException
ResultsetAdapter
getSerialized
in interface ResultsetAdapter
rs
- is the result where to get the valueidx
- is the index of the value in the resultsetnullValue
- represents the nullvalue to return if the column is null
in the resultset
java.sql.SQLException
java.io.IOException
java.lang.ClassNotFoundException
public java.math.BigDecimal getBigDecimal(java.sql.ResultSet rs, int idx, java.math.BigDecimal nullValue) throws java.sql.SQLException
ResultsetAdapter
getBigDecimal
in interface ResultsetAdapter
rs
- is the result where to get the valueidx
- is the index of the value in the resultsetnullValue
- represents the nullvalue to return if the column is null
in the resultset
java.sql.SQLException
public java.math.BigInteger getBigInteger(java.sql.ResultSet rs, int idx, java.math.BigInteger nullValue) throws java.sql.SQLException
ResultsetAdapter
getBigInteger
in interface ResultsetAdapter
rs
- is the result where to get the valueidx
- is the index of the value in the resultsetnullValue
- represents the nullvalue to return if the column is null
in the resultset
java.sql.SQLException
public java.lang.Object getArray(java.sql.ResultSet rs, int idx, java.lang.Object nullValue, int typeCode) throws java.sql.SQLException
ResultsetAdapter
getArray
in interface ResultsetAdapter
rs
- is the result where to get the valueidx
- is the index of the value in the resultsetnullValue
- represents the nullvalue to return if the column is nulltypeCode
- is the type code of the expected array
ex: = (TypeAdapter.ARRAY + TypeAdapter.STRING)
in the resultset
java.sql.SQLException
public void setBoolean(java.sql.PreparedStatement ps, int idx, boolean o) throws java.sql.SQLException
PreparedStatementAdapter
setBoolean
in interface PreparedStatementAdapter
ps
- is the PreparedStatementidx
- is the index of the the value in the PreparedStatemento
- is the value to assign
java.sql.SQLException
public void setOboolean(java.sql.PreparedStatement ps, int idx, java.lang.Boolean o) throws java.sql.SQLException
PreparedStatementAdapter
setOboolean
in interface PreparedStatementAdapter
ps
- is the PreparedStatementidx
- is the index of the the value in the PreparedStatemento
- is the value to assign
java.sql.SQLException
public void setChar(java.sql.PreparedStatement ps, int idx, char c) throws java.sql.SQLException
PreparedStatementAdapter
setChar
in interface PreparedStatementAdapter
ps
- is the PreparedStatementidx
- is the index of the the value in the PreparedStatementc
- is the value to assign
java.sql.SQLException
public void setOchar(java.sql.PreparedStatement ps, int idx, java.lang.Character o) throws java.sql.SQLException
PreparedStatementAdapter
setOchar
in interface PreparedStatementAdapter
ps
- is the PreparedStatementidx
- is the index of the the value in the PreparedStatemento
- is the value to assign
java.sql.SQLException
public void setByte(java.sql.PreparedStatement ps, int idx, byte o) throws java.sql.SQLException
PreparedStatementAdapter
setByte
in interface PreparedStatementAdapter
ps
- is the PreparedStatementidx
- is the index of the the value in the PreparedStatemento
- is the value to assign
java.sql.SQLException
public void setObyte(java.sql.PreparedStatement ps, int idx, java.lang.Byte o) throws java.sql.SQLException
PreparedStatementAdapter
setObyte
in interface PreparedStatementAdapter
ps
- is the PreparedStatementidx
- is the index of the the value in the PreparedStatemento
- is the value to assign
java.sql.SQLException
public void setShort(java.sql.PreparedStatement ps, int idx, short o) throws java.sql.SQLException
PreparedStatementAdapter
setShort
in interface PreparedStatementAdapter
ps
- is the PreparedStatementidx
- is the index of the the value in the PreparedStatemento
- is the value to assign
java.sql.SQLException
public void setOshort(java.sql.PreparedStatement ps, int idx, java.lang.Short o) throws java.sql.SQLException
PreparedStatementAdapter
setOshort
in interface PreparedStatementAdapter
ps
- is the PreparedStatementidx
- is the index of the the value in the PreparedStatemento
- is the value to assign
java.sql.SQLException
public void setInt(java.sql.PreparedStatement ps, int idx, int o) throws java.sql.SQLException
PreparedStatementAdapter
setInt
in interface PreparedStatementAdapter
ps
- is the PreparedStatementidx
- is the index of the the value in the PreparedStatemento
- is the value to assign
java.sql.SQLException
public void setOint(java.sql.PreparedStatement ps, int idx, java.lang.Integer o) throws java.sql.SQLException
PreparedStatementAdapter
setOint
in interface PreparedStatementAdapter
ps
- is the PreparedStatementidx
- is the index of the the value in the PreparedStatemento
- is the value to assign
java.sql.SQLException
public void setLong(java.sql.PreparedStatement ps, int idx, long o) throws java.sql.SQLException
PreparedStatementAdapter
setLong
in interface PreparedStatementAdapter
ps
- is the PreparedStatementidx
- is the index of the the value in the PreparedStatemento
- is the value to assign
java.sql.SQLException
public void setOlong(java.sql.PreparedStatement ps, int idx, java.lang.Long o) throws java.sql.SQLException
PreparedStatementAdapter
setOlong
in interface PreparedStatementAdapter
ps
- is the PreparedStatementidx
- is the index of the the value in the PreparedStatemento
- is the value to assign
java.sql.SQLException
public void setFloat(java.sql.PreparedStatement ps, int idx, float o) throws java.sql.SQLException
PreparedStatementAdapter
setFloat
in interface PreparedStatementAdapter
ps
- is the PreparedStatementidx
- is the index of the the value in the PreparedStatemento
- is the value to assign
java.sql.SQLException
public void setOfloat(java.sql.PreparedStatement ps, int idx, java.lang.Float o) throws java.sql.SQLException
PreparedStatementAdapter
setOfloat
in interface PreparedStatementAdapter
ps
- is the PreparedStatementidx
- is the index of the the value in the PreparedStatemento
- is the value to assign
java.sql.SQLException
public void setDouble(java.sql.PreparedStatement ps, int idx, double o) throws java.sql.SQLException
PreparedStatementAdapter
setDouble
in interface PreparedStatementAdapter
ps
- is the PreparedStatementidx
- is the index of the the value in the PreparedStatemento
- is the value to assign
java.sql.SQLException
public void setOdouble(java.sql.PreparedStatement ps, int idx, java.lang.Double o) throws java.sql.SQLException
PreparedStatementAdapter
setOdouble
in interface PreparedStatementAdapter
ps
- is the PreparedStatementidx
- is the index of the the value in the PreparedStatemento
- is the value to assign
java.sql.SQLException
public void setString(java.sql.PreparedStatement ps, int idx, java.lang.String o) throws java.sql.SQLException
PreparedStatementAdapter
setString
in interface PreparedStatementAdapter
ps
- is the PreparedStatementidx
- is the index of the the value in the PreparedStatemento
- is the value to assign
java.sql.SQLException
public void setDate(java.sql.PreparedStatement ps, int idx, java.util.Date o, java.lang.String columnType) throws java.sql.SQLException
PreparedStatementAdapter
setDate
in interface PreparedStatementAdapter
ps
- is the PreparedStatementidx
- is the index of the the value in the PreparedStatemento
- is the value to assign
java.sql.SQLException
public void setCharArray(java.sql.PreparedStatement ps, int idx, char[] o) throws java.sql.SQLException
PreparedStatementAdapter
setCharArray
in interface PreparedStatementAdapter
ps
- is the PreparedStatementidx
- is the index of the the value in the PreparedStatemento
- is the value to assign
java.sql.SQLException
public void setByteArray(java.sql.PreparedStatement ps, int idx, byte[] o) throws java.sql.SQLException
PreparedStatementAdapter
setByteArray
in interface PreparedStatementAdapter
ps
- is the PreparedStatementidx
- is the index of the the value in the PreparedStatemento
- is the value to assign
java.sql.SQLException
public void setBigInteger(java.sql.PreparedStatement ps, int idx, java.math.BigInteger o) throws java.sql.SQLException
PreparedStatementAdapter
setBigInteger
in interface PreparedStatementAdapter
ps
- is the PreparedStatementidx
- is the index of the the value in the PreparedStatemento
- is the value to assign
java.sql.SQLException
public void setBigDecimal(java.sql.PreparedStatement ps, int idx, java.math.BigDecimal o) throws java.sql.SQLException
PreparedStatementAdapter
setBigDecimal
in interface PreparedStatementAdapter
ps
- is the PreparedStatementidx
- is the index of the the value in the PreparedStatemento
- is the value to assign
java.sql.SQLException
public void setSerialized(java.sql.PreparedStatement ps, int idx, java.io.Serializable o) throws java.sql.SQLException, java.io.IOException
PreparedStatementAdapter
setSerialized
in interface PreparedStatementAdapter
ps
- is the PreparedStatementidx
- is the index of the the value in the PreparedStatemento
- is the value to assign
java.sql.SQLException
java.io.IOException
public void setArray(java.sql.PreparedStatement ps, int idx, java.lang.Object o, int typeCode) throws java.sql.SQLException
PreparedStatementAdapter
setArray
in interface PreparedStatementAdapter
ps
- is the PreparedStatementidx
- is the index of the the value in the PreparedStatemento
- is the value to assigntypeCode
- is the type code of the array
ex: = (TypeAdapter.ARRAY + TypeAdapter.STRING)
java.sql.SQLException
public void escapeFunctionOpen(java.lang.StringBuffer sb)
RdbAdapter
The JDBC standard syntax is "fn{function}".
escapeFunctionOpen
in interface RdbAdapter
sb
- the function expression to be escapedpublic void escapeFunctionClose(java.lang.StringBuffer sb)
RdbAdapter
The JDBC standard syntax is "fn{function}".
escapeFunctionClose
in interface RdbAdapter
sb
- the function expression to be escapedpublic java.lang.String getConcatExpression(java.lang.String op1, java.lang.String op2)
getConcatExpression
in interface RdbAdapter
public java.lang.String getFirstLocateExpression(java.lang.String substring, java.lang.String instring) throws RdbAdapterException
RdbAdapter
Three main syntaxes are found: position(substr in str), locate(substr, srt) and instr(str, substr).
getFirstLocateExpression
in interface RdbAdapter
substring
- The substring searchedinstring
- The string in which to search the substring
RdbAdapterException
public java.lang.String getIndexedLocateExpression(java.lang.String instring, java.lang.String substring, java.lang.String fromIndex) throws RdbAdapterException
RdbAdapter
Two main syntaxes are found: instr() and locate()
getIndexedLocateExpression
in interface RdbAdapter
instring
- The string in which to search the substringsubstring
- The substring searchedfromIndex
- The index from which to start searching
RdbAdapterException
public java.lang.String getLengthOperator() throws RdbAdapterException
getLengthOperator
in interface RdbAdapter
RdbAdapterException
public java.lang.String getQuery(java.lang.String selectClause, java.util.List jts, java.lang.String whereClause, boolean rangeStart, boolean rangeSize)
RdbAdapter
getQuery
in interface RdbAdapter
selectClause
- is a string representation of the select clausejts
- is the tables with their joinwhereClause
- is a string representation of the where clauserangeStart
- is the rank of the first row to be returned in case of
a range limit, starting at 0rangeSize
- is the number of rows to be returned in case of a range
limit. The convention is that Integer.MAX_VALUE means no range limit.public java.lang.String getFromClause(java.util.List jts)
RdbAdapter
getFromClause
in interface RdbAdapter
protected void appendClause(java.lang.StringBuffer sb, java.lang.String clause, java.lang.String value)
public java.lang.String getQuery(java.lang.String selectClause, java.lang.String fromClause, java.lang.String whereClause, java.lang.String orderBy, java.lang.String groupBy, boolean rangeStart, boolean rangeSize)
RdbAdapter
getQuery
in interface RdbAdapter
selectClause
- is a string representation of the select clausewhereClause
- is a string representation of the where clauseorderBy
- is a string representation of the order by clausegroupBy
- is a string representation of the group by clauserangeStart
- is the rank of the first row to be returned in case of
a range limit, starting at 0rangeSize
- is the number of rows to be returned in case of a range
limit. The convention is that Integer.MAX_VALUE means no range limit.protected void getFromClause(JoinedTable jt, java.lang.StringBuffer sb)
public void writeTableAlias(java.lang.String alias, java.lang.StringBuffer sb)
RdbAdapter
writeTableAlias
in interface RdbAdapter
alias
- The table aliassb
- The StringBuffer into which to write the alias.public void writeColumnAlias(java.lang.String alias, java.lang.StringBuffer sb)
RdbAdapter
writeColumnAlias
in interface RdbAdapter
alias
- the column aliassb
- The StringBuffer into which to write the alias.public java.lang.String getColumnAliasExpr(java.lang.String aliasName)
RdbAdapter
getColumnAliasExpr
in interface RdbAdapter
aliasName
- the column aliaspublic java.lang.String handleOrderBy(java.lang.String query)
handleOrderBy
in interface RdbAdapter
public java.lang.String getCreateSequence(java.lang.String seqName) throws java.lang.UnsupportedOperationException
getCreateSequence
in interface SequenceAdapter
seqName
- is the sequence name
java.lang.UnsupportedOperationException
public java.lang.String getNextValInSequence(java.lang.String seqName)
getNextValInSequence
in interface SequenceAdapter
seqName
- is the sequence name
public void getManyNextValInSequence(java.sql.Connection conn, java.lang.String seqName, int numberOfNextVal) throws RdbAdapterException
getManyNextValInSequence
in interface SequenceAdapter
seqName
- the sequence namenumberOfNextVal
- the number of next val called in the same query
RdbAdapterException
protected boolean existRelation(java.sql.Connection connection, java.lang.String relName, java.lang.String[] relationTypes) throws java.sql.SQLException
java.sql.SQLException
public boolean existTable(java.sql.Connection connection, java.lang.String tableName) throws java.sql.SQLException
RdbAdapter
existTable
in interface RdbAdapter
connection
- is the JDBC connection to usetableName
- is the name of the table
java.sql.SQLException
public boolean existView(java.sql.Connection connection, java.lang.String viewName) throws java.sql.SQLException
RdbAdapter
existView
in interface RdbAdapter
connection
- is the JDBC connection to useviewName
- is the name of the view
java.sql.SQLException
public boolean existSequence(java.sql.Connection connection, java.lang.String seqName) throws java.sql.SQLException
SequenceAdapter
existSequence
in interface SequenceAdapter
connection
- is the JDBC connection to useseqName
- is the sequence of the table
java.sql.SQLException
protected void getFromClause(JoinedTable jtMain, JoinedTable jt, JoinedTable.Join join, java.lang.StringBuffer sb)
public static char[] getCharArray(java.lang.Object o) throws java.io.IOException, RdbAdapterException
java.io.IOException
RdbAdapterException
public java.lang.String getSubqueryAlias()
RdbAdapter
getSubqueryAlias
in interface RdbAdapter
public java.lang.String getCreateSequence(java.lang.String seqName, java.lang.Integer startid, java.lang.Integer inc, java.lang.Integer cache) throws java.lang.UnsupportedOperationException
getCreateSequence
in interface SequenceAdapter
seqName
- startid
- inc
- cache
- is the size of the cache
java.lang.UnsupportedOperationException
public void setLogger(Logger _logger)
RdbAdapter
setLogger
in interface RdbAdapter
_logger
- the Monolog logger attached to the RdbAdapterprotected java.lang.String getINCREMENTkeyWord()
protected java.lang.String getSTARTkeyWord()
protected java.lang.String getCACHEkeyWord()
protected void modifySelectClauseWithRange(java.lang.StringBuffer sb, boolean rangeStart, boolean rangeSize)
protected void modifyQueryWithRange(java.lang.StringBuffer sb, boolean rangeStart, boolean rangeSize)
public int getRangeParametersAtStart()
RdbAdapter
Indeed, depending on the database, the SQL syntax may vary, and the parameters can either be put at the front or at the end.
getRangeParametersAtStart
in interface RdbAdapter
public boolean supportArray(int elemTypeCode)
supportArray
in interface TypeAdapter
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |