|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.j256.ormlite.stmt.StatementExecutor<T,ID>
public class StatementExecutor<T,ID>
Executes SQL statements for a particular table in a particular database. Basically a call through to various mapped statement methods.
| Constructor Summary | |
|---|---|
StatementExecutor(DatabaseType databaseType,
TableInfo<T> tableInfo)
Provides statements for various SQL operations. |
|
| Method Summary | |
|---|---|
SelectIterator<T,ID> |
buildIterator(BaseJdbcDao<T,ID> classDao,
DatabaseAccess jdbcTemplate)
Create and return an SelectIterator for the class with a jdbcTemplate an the default mapped query for all
statement. |
SelectIterator<T,ID> |
buildIterator(BaseJdbcDao<T,ID> classDao,
DatabaseAccess jdbcTemplate,
PreparedQuery<T> preparedQuery)
Create and return an SelectIterator for the class with a jdbcTemplate and mapped statement. |
RawResults |
buildIterator(DatabaseAccess jdbcTemplate,
String query)
Return a RawResults object associated with an internal iterator that matches the query argument. |
int |
create(DatabaseAccess template,
T data)
Create a new entry in the database from an object. |
int |
delete(DatabaseAccess template,
T data)
Delete an object from the database. |
int |
deleteIds(DatabaseAccess template,
Collection<ID> ids)
Delete a collection of objects from the database. |
int |
deleteObjects(DatabaseAccess template,
Collection<T> datas)
Delete a collection of objects from the database. |
List<T> |
query(DatabaseAccess jdbcTemplate,
PreparedQuery<T> preparedQuery)
Return a list of all of the data in the table that matches the PreparedQuery. |
List<T> |
queryForAll(DatabaseAccess jdbcTemplate)
Return a list of all of the data in the table. |
T |
queryForFirst(DatabaseAccess jdbcTemplate,
PreparedQuery<T> preparedQuery)
Return the first object that matches the PreparedQuery or null if none. |
T |
queryForId(DatabaseAccess template,
ID id)
Return the object associated with the id or null if none. |
RawResults |
queryRaw(DatabaseAccess jdbcTemplate,
String query)
Return a list of all of the data in the table that matches the PreparedQuery. |
int |
refresh(DatabaseAccess template,
T data)
Does a query for the object's Id and copies in each of the field values from the database to refresh the data parameter. |
int |
update(DatabaseAccess template,
T data)
Update an object in the database. |
int |
updateId(DatabaseAccess template,
T data,
ID newId)
Update an object in the database to change its id to the newId parameter. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StatementExecutor(DatabaseType databaseType,
TableInfo<T> tableInfo)
throws SQLException
SQLException| Method Detail |
|---|
public T queryForId(DatabaseAccess template,
ID id)
throws SQLException
SQLException
public T queryForFirst(DatabaseAccess jdbcTemplate,
PreparedQuery<T> preparedQuery)
throws SQLException
PreparedQuery or null if none.
SQLException
public List<T> queryForAll(DatabaseAccess jdbcTemplate)
throws SQLException
Dao.iterator() if this is the case.
SQLException
public List<T> query(DatabaseAccess jdbcTemplate,
PreparedQuery<T> preparedQuery)
throws SQLException
PreparedQuery. Should be used carefully if
the table is large. Consider using the Dao.iterator() if this is the case.
SQLException
public RawResults queryRaw(DatabaseAccess jdbcTemplate,
String query)
throws SQLException
PreparedQuery. Should be used carefully if
the table is large. Consider using the Dao.iterator() if this is the case.
SQLException
public SelectIterator<T,ID> buildIterator(BaseJdbcDao<T,ID> classDao,
DatabaseAccess jdbcTemplate)
throws SQLException
SelectIterator for the class with a jdbcTemplate an the default mapped query for all
statement.
SQLException
public SelectIterator<T,ID> buildIterator(BaseJdbcDao<T,ID> classDao,
DatabaseAccess jdbcTemplate,
PreparedQuery<T> preparedQuery)
throws SQLException
SelectIterator for the class with a jdbcTemplate and mapped statement.
SQLException
public RawResults buildIterator(DatabaseAccess jdbcTemplate,
String query)
throws SQLException
SQLException
public int create(DatabaseAccess template,
T data)
throws SQLException
SQLException
public int update(DatabaseAccess template,
T data)
throws SQLException
SQLException
public int updateId(DatabaseAccess template,
T data,
ID newId)
throws SQLException
SQLException
public int refresh(DatabaseAccess template,
T data)
throws SQLException
SQLException
public int delete(DatabaseAccess template,
T data)
throws SQLException
SQLException
public int deleteObjects(DatabaseAccess template,
Collection<T> datas)
throws SQLException
SQLException
public int deleteIds(DatabaseAccess template,
Collection<ID> ids)
throws SQLException
SQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||