|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.brains2b.data.Condition | +--org.brains2b.sql.oracle.OracleCondition
Oracle Condition is a specific implementation of Condition for Oracle databases.
org.brainsb2.data.Condition
Field Summary |
Fields inherited from class org.brains2b.data.Condition |
mCond, mOrderBy |
Constructor Summary | |
OracleCondition()
Default Constructor |
|
OracleCondition(java.lang.String orderBy)
Constructor for OracleCondition |
|
OracleCondition(java.lang.String field,
java.lang.Object value)
Constructor for OracleCondition |
|
OracleCondition(java.lang.String field,
java.lang.Object value,
java.lang.String orderBy)
Constructor for OracleCondition |
Method Summary | |
void |
addCondition(java.lang.String field,
java.util.Date value)
Implementation of addCondition which converts normal java.util.Date
to java.sql.Timestamp which is appropriate for Oracle
|
void |
addCondition(java.lang.String field,
java.lang.Object value)
Implementation of addCondition which checks for null values
and makes them absolute so the condition will have a condition FIELD IS NULL
in the query. |
void |
addOrderBy(java.lang.String field,
boolean descending)
adds an Order By statement with the option to sort it descending |
void |
addParameter(int idx,
int i)
adds a integer value for the given placeholder position in the prepared statement. |
void |
addParameter(int idx,
java.lang.Object o)
adds a value for the given placeholder position in the prepared statement. |
java.lang.Object |
getCondition()
abstract function left to specific datasource implementation to actually use condition and order by in a way the implementation does understand |
java.lang.String |
getPreparedQuery()
get the SQL WHERE clause |
java.sql.PreparedStatement |
getPreparedStatement(java.sql.Connection con,
java.lang.String select)
returns a prepared statement build from the prepared query set, the parameters added, the conditions set and the order by supplied. |
void |
setPreparedQuery(java.lang.String preparedQuery)
set the SQL WHERE clause for this condition. |
Methods inherited from class org.brains2b.data.Condition |
addCondition, addOrderBy, clearOrderBy, equals, getConditions, getOrderBy, removeCondition |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public OracleCondition()
Condition.Condition()
public OracleCondition(java.lang.String orderBy)
Condition.Condition(String)
public OracleCondition(java.lang.String field, java.lang.Object value)
Condition.Condition(String, Object)
public OracleCondition(java.lang.String field, java.lang.Object value, java.lang.String orderBy)
Condition.Condition(String, Object, String)
Method Detail |
public java.lang.Object getCondition()
Condition
getCondition
in class Condition
Condition.getCondition()
public java.sql.PreparedStatement getPreparedStatement(java.sql.Connection con, java.lang.String select) throws java.sql.SQLException
If a prepared query has placeholders, the addParameters must be called for every placeholder supplied.
con
- Connection, the connection for which to prepare the query
SQLException,
- throws the Exception if generated by the prepareStatement
command in java.sql.Connection()
java.sql.SQLException
java.sql.Connection()
,
PreparedStatement
public void setPreparedQuery(java.lang.String preparedQuery)
?
to later set parameters to.
A prepared query is a query containing only the query for a table, with or without the "WHERE" keyword.
preparedQuery
- The preparedQuery to setpublic java.lang.String getPreparedQuery()
public void addParameter(int idx, java.lang.Object o)
idx
- int, the placeholder positiono
- Object, the value to set in the prepared statement.public void addParameter(int idx, int i)
idx
- int, the placeholder positioni
- int, The value to set in the prepared statementpublic void addCondition(java.lang.String field, java.lang.Object value)
null
values
and makes them absolute so the condition will have a condition FIELD IS NULL
in the query.
The normal addCondition(String, Object)
does not do this by default and
implementations can differ from data storage to data storage
addCondition
in class Condition
field
- String, the identifiervalue
- Object, the valueCondition.addCondition(String, Object)
public void addCondition(java.lang.String field, java.util.Date value)
java.util.Date
to java.sql.Timestamp
which is appropriate for Oracle
This method checks for null
values and makes them
absolute so the condition will have a condition FIELD IS NULL in the query.
This needs to be done for all output, database types differently
Condition.addCondition(String, Object)
public void addOrderBy(java.lang.String field, boolean descending)
field
- String, the field name as it occurs in the table
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |