|
|||||||||||
| 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.PostgresAdapter
| Field Summary | |
private static java.lang.String |
POSTGRESCONCAT
|
| 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 | |
PostgresAdapter()
|
|
| Method Summary | |
void |
escapeFunctionClose(java.lang.StringBuffer sb)
Modifies the end of a function expression for the escape syntax. |
void |
escapeFunctionOpen(java.lang.StringBuffer sb)
Postgres does not support 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 |
int |
fetchResultSetSize(java.sql.ResultSet rs)
This calculates the size of a result set. |
java.lang.String |
getArrayElementAsSQLString(java.lang.Object elem,
int elemTypeCode)
|
java.lang.String |
getArrayValueAsSQLStringBegin()
|
java.lang.String |
getArrayValueAsSQLStringEnd()
|
java.lang.String |
getConcatExpression(java.lang.String op1,
java.lang.String op2)
|
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. |
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 |
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(java.lang.Object value,
int typeCode)
This method returns a String value that represents a value. |
protected void |
modifyQueryWithRange(java.lang.StringBuffer sb,
boolean rangeStart,
boolean rangeSize)
|
protected void |
modifySelectClauseWithRange(java.lang.StringBuffer sb,
boolean rangeStart,
boolean rangeSize)
|
boolean |
supportBatchPreparedStatement()
Indicates if the driver supports the batch of PreparedStatement |
| 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 POSTGRESCONCAT
| Constructor Detail |
public PostgresAdapter()
| Method Detail |
public boolean supportBatchPreparedStatement()
RdbAdapter
supportBatchPreparedStatement in interface RdbAdaptersupportBatchPreparedStatement in class BasicRdbAdapter
public java.lang.String getSqlType(int typeCode,
boolean usedInPK,
int size,
int scale)
throws RdbAdapterException
TypeAdapter
getSqlType in interface TypeAdaptergetSqlType in class BasicRdbAdapterRdbAdapterExceptionpublic java.lang.String getValueAsSQLString(boolean value)
ValueAsSQLStringAdapter
getValueAsSQLString in interface ValueAsSQLStringAdaptergetValueAsSQLString in class BasicRdbAdapter
public java.lang.String getValueAsSQLString(java.lang.Object value,
int typeCode)
ValueAsSQLStringAdapter
getValueAsSQLString in interface ValueAsSQLStringAdaptergetValueAsSQLString in class BasicRdbAdapterpublic void escapeFunctionOpen(java.lang.StringBuffer sb)
escapeFunctionOpen in interface RdbAdapterescapeFunctionOpen in class BasicRdbAdapterpublic void escapeFunctionClose(java.lang.StringBuffer sb)
RdbAdapterThe JDBC standard syntax is "fn{function}".
escapeFunctionClose in interface RdbAdapterescapeFunctionClose in class BasicRdbAdapter
public java.lang.String getConcatExpression(java.lang.String op1,
java.lang.String op2)
getConcatExpression in interface RdbAdaptergetConcatExpression in class BasicRdbAdapter
public java.lang.String getFirstLocateExpression(java.lang.String substring,
java.lang.String instring)
RdbAdapterThree main syntaxes are found: position(substr in str), locate(substr, srt) and instr(str, substr).
getFirstLocateExpression in interface RdbAdaptergetFirstLocateExpression in class BasicRdbAdapter
public java.lang.String getIndexedLocateExpression(java.lang.String instring,
java.lang.String substring,
java.lang.String fromIndex)
throws RdbAdapterException
RdbAdapterTwo main syntaxes are found: instr() and locate()
getIndexedLocateExpression in interface RdbAdaptergetIndexedLocateExpression in class BasicRdbAdapterRdbAdapterException
public int fetchResultSetSize(java.sql.ResultSet rs)
throws java.sql.SQLException
fetchResultSetSize in interface RdbAdapterfetchResultSetSize in class BasicRdbAdapterrs - the result set which the size must be returned
java.sql.SQLException
public boolean existSequence(java.sql.Connection connection,
java.lang.String seqName)
throws java.sql.SQLException
SequenceAdapter
existSequence in interface SequenceAdapterexistSequence in class BasicRdbAdapterjava.sql.SQLException
protected boolean existRelation(java.sql.Connection connection,
java.lang.String relName,
java.lang.String[] relationTypes)
throws java.sql.SQLException
existRelation in class BasicRdbAdapterjava.sql.SQLExceptionpublic java.lang.String getSubqueryAlias()
RdbAdapter
getSubqueryAlias in interface RdbAdaptergetSubqueryAlias in class BasicRdbAdapter
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 BasicRdbAdapterpublic int getRangeParametersAtStart()
RdbAdapterIndeed, 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 RdbAdaptergetRangeParametersAtStart in class BasicRdbAdapterpublic java.lang.String getArrayValueAsSQLStringBegin()
getArrayValueAsSQLStringBegin in class BasicRdbAdapterpublic java.lang.String getArrayValueAsSQLStringEnd()
getArrayValueAsSQLStringEnd in class BasicRdbAdapter
public java.lang.String getArrayElementAsSQLString(java.lang.Object elem,
int elemTypeCode)
getArrayElementAsSQLString in class BasicRdbAdapter
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||