|
||||||||||
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
org.objectweb.jorm.mapper.rdb.adapter.OracleAdapter
public class OracleAdapter
Field Summary | |
---|---|
private int |
defaultBytearraySize
|
private int |
defaultChararraySize
|
private java.lang.String[] |
GROUP_FUNCTIONS
|
private static java.lang.String |
ORACLEFIRSTLOCATE
|
private static java.lang.String |
PROP_BASE
|
static java.util.Map |
properties
|
static java.lang.String[][] |
PROPS
|
private int |
varcharSize
|
private int |
varcharSizeInPk
|
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 | |
---|---|
OracleAdapter()
|
|
OracleAdapter(java.lang.String name)
|
Method Summary | |
---|---|
private boolean |
containGroupFunction(java.lang.String selectClause)
|
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 |
java.lang.String |
getColumnAliasExpr(java.lang.String aliasName)
Returns a column alias expression. |
private static int |
getDefaultSize(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. |
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. |
void |
getManyNextValInSequence(java.sql.Connection conn,
java.lang.String seqName,
int numberOfNextVal)
|
java.lang.String |
getNextValInSequence(java.lang.String seqName)
|
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.lang.String |
getSqlType(int typeCode,
boolean usedInPK,
int size,
int scale)
This method returns the SQL type linked to the java type |
java.lang.String |
getValueAsSQLString(java.lang.Object value,
int typeCode)
This method returns a String value that represents a 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 |
setVarcharSize(int s)
|
void |
setVarcharSizeInPk(int s)
|
boolean |
supportBatchPreparedStatement()
Indicates if the driver supports the batch of PreparedStatement |
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 PROP_BASE
private static final java.lang.String ORACLEFIRSTLOCATE
public static final java.lang.String[][] PROPS
public static final java.util.Map properties
private int varcharSize
private int defaultBytearraySize
private int defaultChararraySize
private int varcharSizeInPk
private final java.lang.String[] GROUP_FUNCTIONS
Constructor Detail |
---|
public OracleAdapter()
public OracleAdapter(java.lang.String name)
Method Detail |
---|
private static final int getDefaultSize(int idx)
public void setVarcharSize(int s)
public void setVarcharSizeInPk(int s)
public boolean supportBatchPreparedStatement()
RdbAdapter
supportBatchPreparedStatement
in interface RdbAdapter
supportBatchPreparedStatement
in class BasicRdbAdapter
public java.lang.String getSqlType(int typeCode, boolean usedInPK, int size, int scale) throws RdbAdapterException
TypeAdapter
getSqlType
in interface TypeAdapter
getSqlType
in class BasicRdbAdapter
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 java.lang.String getFirstLocateExpression(java.lang.String substring, java.lang.String instring)
RdbAdapter
Three main syntaxes are found: position(substr in str), locate(substr, srt) and instr(str, substr).
getFirstLocateExpression
in interface RdbAdapter
getFirstLocateExpression
in class BasicRdbAdapter
substring
- The substring searchedinstring
- The string in which to search the substring
public java.lang.String getIndexedLocateExpression(java.lang.String instring, java.lang.String substring, java.lang.String fromIndex)
RdbAdapter
Two main syntaxes are found: instr() and locate()
getIndexedLocateExpression
in interface RdbAdapter
getIndexedLocateExpression
in class BasicRdbAdapter
instring
- The string in which to search the substringsubstring
- The substring searchedfromIndex
- The index from which to start searching
public void writeTableAlias(java.lang.String alias, java.lang.StringBuffer sb)
RdbAdapter
writeTableAlias
in interface RdbAdapter
writeTableAlias
in class BasicRdbAdapter
alias
- The table aliassb
- The StringBuffer into which to write the alias.public java.lang.String getColumnAliasExpr(java.lang.String aliasName)
RdbAdapter
getColumnAliasExpr
in interface RdbAdapter
getColumnAliasExpr
in class BasicRdbAdapter
aliasName
- the column aliaspublic void writeColumnAlias(java.lang.String alias, java.lang.StringBuffer sb)
RdbAdapter
writeColumnAlias
in interface RdbAdapter
writeColumnAlias
in class BasicRdbAdapter
alias
- the column aliassb
- The StringBuffer into which to write the alias.public java.lang.String handleOrderBy(java.lang.String query)
handleOrderBy
in interface RdbAdapter
handleOrderBy
in class BasicRdbAdapter
public java.lang.String getNextValInSequence(java.lang.String seqName)
getNextValInSequence
in interface SequenceAdapter
getNextValInSequence
in class BasicRdbAdapter
seqName
- is the sequence name
public void getManyNextValInSequence(java.sql.Connection conn, java.lang.String seqName, int numberOfNextVal) throws RdbAdapterException
getManyNextValInSequence
in interface SequenceAdapter
getManyNextValInSequence
in class BasicRdbAdapter
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
existRelation
in class BasicRdbAdapter
java.sql.SQLException
public boolean existSequence(java.sql.Connection connection, java.lang.String seqName) throws java.sql.SQLException
SequenceAdapter
existSequence
in interface SequenceAdapter
existSequence
in class BasicRdbAdapter
connection
- is the JDBC connection to useseqName
- is the sequence of the table
java.sql.SQLException
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
getQuery
in class BasicRdbAdapter
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 modifySelectClauseWithRange(java.lang.StringBuffer sb, boolean rangeStart, boolean rangeSize)
modifySelectClauseWithRange
in class BasicRdbAdapter
protected void modifyQueryWithRange(java.lang.StringBuffer sb, boolean rangeStart, boolean rangeSize)
modifyQueryWithRange
in class BasicRdbAdapter
private boolean containGroupFunction(java.lang.String selectClause)
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
getRangeParametersAtStart
in class BasicRdbAdapter
public java.lang.String getValueAsSQLString(java.lang.Object value, int typeCode)
ValueAsSQLStringAdapter
getValueAsSQLString
in interface ValueAsSQLStringAdapter
getValueAsSQLString
in class BasicRdbAdapter
typeCode
- is the java type of the value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |