|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Objectorg.jdbcpersistence.JDBCQuery
public class JDBCQuery
JDBCQuery object encapsulates a Data Manipulation Language SQL statement. It is used to run query or update an underlying
database.
When the query is a select statement the results can be returned ad List of Maps or a
List of beans. This is controlled by the resultType argument passed into the query.
When resultType argument to the query is
java.utils.Map.class the result will be a List of Maps.
java.utils.List the result will be a list, where each item is an object returned by ResultSet.getObject(1) method.
JDBCPersistence a List of instances of that class.
JDBCQuery using addFlavour method.
JDBCConnection.executeQuery(JDBCQuery,Object[],java.util.List),
JDBCConnection.executeUpdate(JDBCQuery,Object[]),
JDBCPersistence| Constructor Summary | |
|---|---|
JDBCQuery(java.lang.String query)
Constructor that accepts a default SQL statement and no resultType. |
|
JDBCQuery(java.lang.String query,
java.lang.Class resultType,
java.lang.Class jdbcQueryReaderClass)
Constructor that accepts a default SQL statement and a resultType. |
|
| Method Summary | |
|---|---|
void |
addFlavour(java.lang.String flavour,
java.lang.String query)
Adds a SQL statement fine-tuned to a particular database. |
java.lang.Class |
getJdbcResultSetReader()
|
java.lang.String |
getQuery(java.lang.String flavour)
Returns a SQL statement fine-tuned to a particular database. |
java.lang.Class |
getResultType()
Returns Class associated with this JDBCQuery |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JDBCQuery(java.lang.String query)
JDBCQuery being created will be used to update database
query - SQL statement
public JDBCQuery(java.lang.String query,
java.lang.Class resultType,
java.lang.Class jdbcQueryReaderClass)
resultType denotes what result the query will return.
query - SQL statementresultType - regitered persistent class or java.utils.Map| Method Detail |
|---|
public void addFlavour(java.lang.String flavour,
java.lang.String query)
flavour - the name of the database. This name should equals to a lowercase string returned by
java.sql.DatabaseMetaData.getDatabaseProductName() method.query - SQL statementJDBCPersistencepublic java.lang.String getQuery(java.lang.String flavour)
JDBCQuery object, then default SQL statement is returned
flavour -
public java.lang.Class getResultType()
Class associated with this JDBCQuery
public java.lang.Class getJdbcResultSetReader()
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||