|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.objectweb.jorm.mapper.rdb.adapter.BasicRdbAdapter
Constructor Summary | |
BasicRdbAdapter()
|
Method Summary | |
boolean |
existSequence(java.sql.Connection connection,
java.lang.String seqName)
|
boolean |
existTable(java.sql.Connection connection,
java.lang.String tableName)
|
int |
fetchResultSetSize(java.sql.ResultSet rs)
This calculates the size of a result set. |
java.math.BigDecimal |
getBigDecimal(java.sql.ResultSet rs,
int idx)
|
boolean |
getBoolean(java.sql.ResultSet rs,
int idx)
|
byte |
getByte(java.sql.ResultSet rs,
int idx)
|
byte[] |
getByteArray(java.sql.ResultSet rs,
int idx)
|
char |
getChar(java.sql.ResultSet rs,
int idx)
|
static char[] |
getCharArray(java.lang.Object o)
|
char[] |
getCharArray(java.sql.ResultSet rs,
int idx)
|
java.lang.String |
getConcatExpression(java.lang.String op1,
java.lang.String op2)
|
java.lang.String |
getCreateSequence(java.lang.String seqName)
|
java.util.Date |
getDate(java.sql.ResultSet rs,
int idx)
|
java.util.Date |
getDate(java.sql.ResultSet rs,
int idx,
java.lang.String sqlColumnType)
|
double |
getDouble(java.sql.ResultSet rs,
int idx)
|
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)
|
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 |
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)
|
long |
getLong(java.sql.ResultSet rs,
int idx)
|
java.lang.String |
getNextValInSequence(java.lang.String seqName)
|
java.lang.Boolean |
getOboolean(java.sql.ResultSet rs,
int idx)
|
java.lang.Byte |
getObyte(java.sql.ResultSet rs,
int idx)
|
java.lang.Character |
getOchar(java.sql.ResultSet rs,
int idx)
|
java.lang.Double |
getOdouble(java.sql.ResultSet rs,
int idx)
|
java.lang.Float |
getOfloat(java.sql.ResultSet rs,
int idx)
|
java.lang.Integer |
getOint(java.sql.ResultSet rs,
int idx)
|
java.lang.Long |
getOlong(java.sql.ResultSet rs,
int idx)
|
java.lang.Short |
getOshort(java.sql.ResultSet rs,
int idx)
|
java.lang.String |
getQuery(java.lang.String selectClause,
java.util.List jts,
java.lang.String whereclause)
|
java.io.Serializable |
getSerialized(java.sql.ResultSet rs,
int idx)
|
short |
getShort(java.sql.ResultSet rs,
int idx)
|
java.lang.String |
getSqlGetterName(PType pt,
java.lang.String resultSet,
int idx)
This method returns the sql getter method associated to the PType specified in parameter. |
java.lang.String |
getSqlGetterName(PType pt,
java.lang.String resultSet,
int idx,
java.lang.String sqlColumnType)
This method returns the sql getter method associated to the PType specified in parameter. |
java.lang.String |
getSqlSetterName(PType pt,
java.lang.String value,
int idx)
This method returns the sql setter method associated to the PType specified in parameter. |
java.lang.String |
getSqlSetterName(PType pt,
java.lang.String value,
int idx,
java.lang.String sqlColumnType)
This method returns the sql setter method associated to the PType specified in parameter. |
java.lang.String |
getSqlType(PType pt,
boolean usedInPK,
int size)
This method returns the SQL type linked to the PType specified in parameter. |
int |
getSqlTypeCode(PType pt)
This methods return the SQL type code linked to the PType specified in parameter. |
int |
getSqlTypeCode(PType pt,
java.lang.String sqlColumnType)
This methods return the SQL type code linked to the PType specified in parameter. |
java.lang.String |
getString(java.sql.ResultSet rs,
int idx)
|
java.lang.String |
getSubstringName()
|
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,
PType type)
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. |
protected void |
getWhereClause(java.util.List jts,
java.lang.StringBuffer sb,
java.lang.String whereclause)
|
java.lang.String |
handleOrderBy(java.lang.String query)
|
void |
setBigDecimal(java.sql.PreparedStatement ps,
int idx,
java.math.BigDecimal o)
|
void |
setBoolean(java.sql.PreparedStatement ps,
int idx,
boolean o)
|
void |
setByte(java.sql.PreparedStatement ps,
int idx,
byte o)
|
void |
setByteArray(java.sql.PreparedStatement ps,
int idx,
byte[] o)
|
void |
setChar(java.sql.PreparedStatement ps,
int idx,
char c)
|
void |
setCharArray(java.sql.PreparedStatement ps,
int idx,
char[] o)
|
void |
setDate(java.sql.PreparedStatement ps,
int idx,
java.util.Date o,
java.lang.String columnType)
|
void |
setDouble(java.sql.PreparedStatement ps,
int idx,
double o)
|
void |
setFloat(java.sql.PreparedStatement ps,
int idx,
float o)
|
void |
setInt(java.sql.PreparedStatement ps,
int idx,
int o)
|
void |
setLong(java.sql.PreparedStatement ps,
int idx,
long o)
|
void |
setOboolean(java.sql.PreparedStatement ps,
int idx,
java.lang.Boolean o)
|
void |
setObyte(java.sql.PreparedStatement ps,
int idx,
java.lang.Byte o)
|
void |
setOchar(java.sql.PreparedStatement ps,
int idx,
java.lang.Character o)
|
void |
setOdouble(java.sql.PreparedStatement ps,
int idx,
java.lang.Double o)
|
void |
setOfloat(java.sql.PreparedStatement ps,
int idx,
java.lang.Float o)
|
void |
setOint(java.sql.PreparedStatement ps,
int idx,
java.lang.Integer o)
|
void |
setOlong(java.sql.PreparedStatement ps,
int idx,
java.lang.Long o)
|
void |
setOshort(java.sql.PreparedStatement ps,
int idx,
java.lang.Short o)
|
void |
setSerialized(java.sql.PreparedStatement ps,
int idx,
java.io.Serializable o)
|
void |
setShort(java.sql.PreparedStatement ps,
int idx,
short o)
|
void |
setString(java.sql.PreparedStatement ps,
int idx,
java.lang.String o)
|
boolean |
supportBatchPreparedStatement()
Indicates if the driver supports the batch of PreparedStatement |
void |
writeTableAlias(java.lang.String alias,
java.lang.StringBuffer sb)
Used to write table aliases, for which the syntax may vary (use of 'as', except for Oracle) |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BasicRdbAdapter()
Method Detail |
public boolean supportBatchPreparedStatement()
RdbAdapter
supportBatchPreparedStatement
in interface RdbAdapter
public int getSqlTypeCode(PType pt) throws PExceptionProtocol
getSqlTypeCode
in interface RdbAdapter
PExceptionProtocol
public int getSqlTypeCode(PType pt, java.lang.String sqlColumnType) throws PExceptionProtocol
getSqlTypeCode
in interface RdbAdapter
PExceptionProtocol
public java.lang.String getSqlType(PType pt, boolean usedInPK, int size) throws PExceptionProtocol
RdbAdapter
getSqlType
in interface RdbAdapter
PExceptionProtocol
public java.lang.String getSqlGetterName(PType pt, java.lang.String resultSet, int idx) throws PExceptionProtocol
RdbAdapter
getSqlGetterName
in interface RdbAdapter
PExceptionProtocol
public java.lang.String getSqlGetterName(PType pt, java.lang.String resultSet, int idx, java.lang.String sqlColumnType) throws PExceptionProtocol
RdbAdapter
getSqlGetterName
in interface RdbAdapter
PExceptionProtocol
public java.lang.String getSqlSetterName(PType pt, java.lang.String value, int idx) throws PExceptionProtocol
RdbAdapter
getSqlSetterName
in interface RdbAdapter
PExceptionProtocol
public java.lang.String getSqlSetterName(PType pt, java.lang.String value, int idx, java.lang.String sqlColumnType) throws PExceptionProtocol
RdbAdapter
getSqlSetterName
in interface RdbAdapter
PExceptionProtocol
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, PType type)
RdbAdapter
getValueAsSQLString
in interface RdbAdapter
value
- type
- is the PType of the @valuepublic java.lang.String getValueAsSQLString(boolean value)
RdbAdapter
getValueAsSQLString
in interface RdbAdapter
public java.lang.String getValueAsSQLString(byte value)
RdbAdapter
getValueAsSQLString
in interface RdbAdapter
public java.lang.String getValueAsSQLString(char value)
RdbAdapter
getValueAsSQLString
in interface RdbAdapter
public java.lang.String getValueAsSQLString(short value)
RdbAdapter
getValueAsSQLString
in interface RdbAdapter
public java.lang.String getValueAsSQLString(int value)
RdbAdapter
getValueAsSQLString
in interface RdbAdapter
public java.lang.String getValueAsSQLString(long value)
RdbAdapter
getValueAsSQLString
in interface RdbAdapter
public java.lang.String getValueAsSQLString(float value)
RdbAdapter
getValueAsSQLString
in interface RdbAdapter
public java.lang.String getValueAsSQLString(double value)
RdbAdapter
getValueAsSQLString
in interface RdbAdapter
public boolean getBoolean(java.sql.ResultSet rs, int idx) throws java.sql.SQLException
getBoolean
in interface RdbAdapter
java.sql.SQLException
public java.lang.Boolean getOboolean(java.sql.ResultSet rs, int idx) throws java.sql.SQLException
getOboolean
in interface RdbAdapter
java.sql.SQLException
public char getChar(java.sql.ResultSet rs, int idx) throws java.sql.SQLException
getChar
in interface RdbAdapter
java.sql.SQLException
public java.lang.Character getOchar(java.sql.ResultSet rs, int idx) throws java.sql.SQLException
getOchar
in interface RdbAdapter
java.sql.SQLException
public byte getByte(java.sql.ResultSet rs, int idx) throws java.sql.SQLException
getByte
in interface RdbAdapter
java.sql.SQLException
public java.lang.Byte getObyte(java.sql.ResultSet rs, int idx) throws java.sql.SQLException
getObyte
in interface RdbAdapter
java.sql.SQLException
public short getShort(java.sql.ResultSet rs, int idx) throws java.sql.SQLException
getShort
in interface RdbAdapter
java.sql.SQLException
public java.lang.Short getOshort(java.sql.ResultSet rs, int idx) throws java.sql.SQLException
getOshort
in interface RdbAdapter
java.sql.SQLException
public int getInt(java.sql.ResultSet rs, int idx) throws java.sql.SQLException
getInt
in interface RdbAdapter
java.sql.SQLException
public java.lang.Integer getOint(java.sql.ResultSet rs, int idx) throws java.sql.SQLException
getOint
in interface RdbAdapter
java.sql.SQLException
public long getLong(java.sql.ResultSet rs, int idx) throws java.sql.SQLException
getLong
in interface RdbAdapter
java.sql.SQLException
public java.lang.Long getOlong(java.sql.ResultSet rs, int idx) throws java.sql.SQLException
getOlong
in interface RdbAdapter
java.sql.SQLException
public float getFloat(java.sql.ResultSet rs, int idx) throws java.sql.SQLException
getFloat
in interface RdbAdapter
java.sql.SQLException
public java.lang.Float getOfloat(java.sql.ResultSet rs, int idx) throws java.sql.SQLException
getOfloat
in interface RdbAdapter
java.sql.SQLException
public double getDouble(java.sql.ResultSet rs, int idx) throws java.sql.SQLException
getDouble
in interface RdbAdapter
java.sql.SQLException
public java.lang.Double getOdouble(java.sql.ResultSet rs, int idx) throws java.sql.SQLException
getOdouble
in interface RdbAdapter
java.sql.SQLException
public java.lang.String getString(java.sql.ResultSet rs, int idx) throws java.sql.SQLException
getString
in interface RdbAdapter
java.sql.SQLException
public java.util.Date getDate(java.sql.ResultSet rs, int idx) throws java.sql.SQLException
getDate
in interface RdbAdapter
java.sql.SQLException
public java.util.Date getDate(java.sql.ResultSet rs, int idx, java.lang.String sqlColumnType) throws java.sql.SQLException
getDate
in interface RdbAdapter
java.sql.SQLException
public char[] getCharArray(java.sql.ResultSet rs, int idx) throws java.sql.SQLException
getCharArray
in interface RdbAdapter
java.sql.SQLException
public byte[] getByteArray(java.sql.ResultSet rs, int idx) throws java.sql.SQLException
getByteArray
in interface RdbAdapter
java.sql.SQLException
public java.io.Serializable getSerialized(java.sql.ResultSet rs, int idx) throws java.sql.SQLException, java.io.IOException, java.lang.ClassNotFoundException
getSerialized
in interface RdbAdapter
java.sql.SQLException
java.io.IOException
java.lang.ClassNotFoundException
public java.math.BigDecimal getBigDecimal(java.sql.ResultSet rs, int idx) throws java.sql.SQLException
getBigDecimal
in interface RdbAdapter
java.sql.SQLException
public void setBoolean(java.sql.PreparedStatement ps, int idx, boolean o) throws java.sql.SQLException
setBoolean
in interface RdbAdapter
java.sql.SQLException
public void setOboolean(java.sql.PreparedStatement ps, int idx, java.lang.Boolean o) throws java.sql.SQLException
setOboolean
in interface RdbAdapter
java.sql.SQLException
public void setChar(java.sql.PreparedStatement ps, int idx, char c) throws java.sql.SQLException
setChar
in interface RdbAdapter
java.sql.SQLException
public void setOchar(java.sql.PreparedStatement ps, int idx, java.lang.Character o) throws java.sql.SQLException
setOchar
in interface RdbAdapter
java.sql.SQLException
public void setByte(java.sql.PreparedStatement ps, int idx, byte o) throws java.sql.SQLException
setByte
in interface RdbAdapter
java.sql.SQLException
public void setObyte(java.sql.PreparedStatement ps, int idx, java.lang.Byte o) throws java.sql.SQLException
setObyte
in interface RdbAdapter
java.sql.SQLException
public void setShort(java.sql.PreparedStatement ps, int idx, short o) throws java.sql.SQLException
setShort
in interface RdbAdapter
java.sql.SQLException
public void setOshort(java.sql.PreparedStatement ps, int idx, java.lang.Short o) throws java.sql.SQLException
setOshort
in interface RdbAdapter
java.sql.SQLException
public void setInt(java.sql.PreparedStatement ps, int idx, int o) throws java.sql.SQLException
setInt
in interface RdbAdapter
java.sql.SQLException
public void setOint(java.sql.PreparedStatement ps, int idx, java.lang.Integer o) throws java.sql.SQLException
setOint
in interface RdbAdapter
java.sql.SQLException
public void setLong(java.sql.PreparedStatement ps, int idx, long o) throws java.sql.SQLException
setLong
in interface RdbAdapter
java.sql.SQLException
public void setOlong(java.sql.PreparedStatement ps, int idx, java.lang.Long o) throws java.sql.SQLException
setOlong
in interface RdbAdapter
java.sql.SQLException
public void setFloat(java.sql.PreparedStatement ps, int idx, float o) throws java.sql.SQLException
setFloat
in interface RdbAdapter
java.sql.SQLException
public void setOfloat(java.sql.PreparedStatement ps, int idx, java.lang.Float o) throws java.sql.SQLException
setOfloat
in interface RdbAdapter
java.sql.SQLException
public void setDouble(java.sql.PreparedStatement ps, int idx, double o) throws java.sql.SQLException
setDouble
in interface RdbAdapter
java.sql.SQLException
public void setOdouble(java.sql.PreparedStatement ps, int idx, java.lang.Double o) throws java.sql.SQLException
setOdouble
in interface RdbAdapter
java.sql.SQLException
public void setString(java.sql.PreparedStatement ps, int idx, java.lang.String o) throws java.sql.SQLException
setString
in interface RdbAdapter
java.sql.SQLException
public void setDate(java.sql.PreparedStatement ps, int idx, java.util.Date o, java.lang.String columnType) throws java.sql.SQLException
setDate
in interface RdbAdapter
java.sql.SQLException
public void setCharArray(java.sql.PreparedStatement ps, int idx, char[] o) throws java.sql.SQLException
setCharArray
in interface RdbAdapter
java.sql.SQLException
public void setByteArray(java.sql.PreparedStatement ps, int idx, byte[] o) throws java.sql.SQLException
setByteArray
in interface RdbAdapter
java.sql.SQLException
public void setBigDecimal(java.sql.PreparedStatement ps, int idx, java.math.BigDecimal o) throws java.sql.SQLException
setBigDecimal
in interface RdbAdapter
java.sql.SQLException
public void setSerialized(java.sql.PreparedStatement ps, int idx, java.io.Serializable o) throws java.sql.SQLException, java.io.IOException
setSerialized
in interface RdbAdapter
java.sql.SQLException
java.io.IOException
public java.lang.String getSubstringName()
getSubstringName
in interface RdbAdapter
public 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 PException
RdbAdapter
Two main syntaxes are found: position(substr in str) and instr(str, substr).
getFirstLocateExpression
in interface RdbAdapter
substring
- The substring searchedinstring
- The string in which to search the substring
PException
public java.lang.String getIndexedLocateExpression(java.lang.String instring, java.lang.String substring, java.lang.String fromIndex) throws PException
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
PException
public java.lang.String getQuery(java.lang.String selectClause, java.util.List jts, java.lang.String whereclause)
getQuery
in interface RdbAdapter
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 java.lang.String handleOrderBy(java.lang.String query)
handleOrderBy
in interface RdbAdapter
public java.lang.String getCreateSequence(java.lang.String seqName)
getCreateSequence
in interface RdbAdapter
public java.lang.String getNextValInSequence(java.lang.String seqName)
getNextValInSequence
in interface RdbAdapter
public boolean existTable(java.sql.Connection connection, java.lang.String tableName) throws java.sql.SQLException
existTable
in interface RdbAdapter
java.sql.SQLException
public boolean existSequence(java.sql.Connection connection, java.lang.String seqName) throws java.sql.SQLException
existSequence
in interface RdbAdapter
java.sql.SQLException
protected void getFromClause(JoinedTable jtMain, JoinedTable jt, JoinedTable.Join join, java.lang.StringBuffer sb)
protected void getWhereClause(java.util.List jts, java.lang.StringBuffer sb, java.lang.String whereclause)
public static char[] getCharArray(java.lang.Object o) throws java.lang.Exception
java.lang.Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |