|
Spring Data JDBC Extensions | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.data.jdbc.query.QueryDslJdbcTemplate
public class QueryDslJdbcTemplate
Template class with a basic set of JDBC operations, allowing the use of QueryDSL features.
This class delegates to a wrapped JdbcTemplate.
The underlying JdbcTemplate is
exposed to allow for convenient access to the traditional
JdbcTemplate methods.
Thanks to Alex Soto (@alexsotob) for getting this started and implementing the
initial prototype version.
JdbcTemplate| Constructor Summary | |
|---|---|
QueryDslJdbcTemplate(DataSource dataSource)
|
|
QueryDslJdbcTemplate(JdbcTemplate jdbcTemplate)
|
|
| Method Summary | ||
|---|---|---|
long |
count(com.mysema.query.sql.SQLQuery sqlQuery)
Count the rows that are part of the results for the given SQLQuery |
|
long |
countDistinct(com.mysema.query.sql.SQLQuery sqlQuery)
Count the distinct rows that are part of the results for the given SQLQuery |
|
long |
delete(com.mysema.query.sql.RelationalPath<?> entity,
SqlDeleteCallback callback)
Execute a database delete using the provided SqlDeleteCallback. |
|
boolean |
exists(com.mysema.query.sql.SQLQuery sqlQuery)
Determine if the result for the given SQLQuery contains some rows |
|
JdbcOperations |
getJdbcOperations()
Expose the classic Spring JdbcTemplate to allow invocation of classic JDBC operations. |
|
long |
insert(com.mysema.query.sql.RelationalPath<?> entity,
SqlInsertCallback callback)
Execute a database insert using the provided SqlInsertCallback. |
|
|
insertWithKey(com.mysema.query.sql.RelationalPath<?> entity,
SqlInsertWithKeyCallback<K> callback)
Execute a database insert using the provided SqlInsertWithKeyCallback. |
|
com.mysema.query.sql.SQLQuery |
newSqlQuery()
Create a new SQLQuery for this configuration. |
|
boolean |
notExists(com.mysema.query.sql.SQLQuery sqlQuery)
Determine if the result for the given SQLQuery is empty |
|
|
query(com.mysema.query.sql.SQLQuery sqlQuery,
com.mysema.query.types.Expression<T> expression)
Query for a list of objects using the SQLQuery. |
|
|
query(com.mysema.query.sql.SQLQuery sqlQuery,
ResultSetExtractor<List<T>> resultSetExtractor,
com.mysema.query.types.Expression<?>... projection)
Query for a list of objects using the SQLQuery. |
|
|
query(com.mysema.query.sql.SQLQuery sqlQuery,
RowMapper<T> rowMapper,
com.mysema.query.types.Expression<?>... projection)
Query for a list of objects using the SQLQuery. |
|
|
queryForObject(com.mysema.query.sql.SQLQuery sqlQuery,
com.mysema.query.types.Expression<T> expression)
Query for a single object using the SQLQuery. |
|
|
queryForObject(com.mysema.query.sql.SQLQuery sqlQuery,
ResultSetExtractor<T> resultSetExtractor,
com.mysema.query.types.Expression<?>... projection)
Query for a single object using the SQLQuery. |
|
|
queryForObject(com.mysema.query.sql.SQLQuery sqlQuery,
RowMapper<T> rowMapper,
com.mysema.query.types.Expression<?>... projection)
Query for a single object using the SQLQuery. |
|
long |
update(com.mysema.query.sql.RelationalPath<?> entity,
SqlUpdateCallback callback)
Execute a database update using the provided SqlUpdateCallback. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public QueryDslJdbcTemplate(DataSource dataSource)
public QueryDslJdbcTemplate(JdbcTemplate jdbcTemplate)
| Method Detail |
|---|
public JdbcOperations getJdbcOperations()
QueryDslJdbcOperations
getJdbcOperations in interface QueryDslJdbcOperationspublic com.mysema.query.sql.SQLQuery newSqlQuery()
QueryDslJdbcOperationsSQLQuery for this configuration.
newSqlQuery in interface QueryDslJdbcOperationspublic long count(com.mysema.query.sql.SQLQuery sqlQuery)
QueryDslJdbcOperationsSQLQuery
count in interface QueryDslJdbcOperationssqlQuery - query to be used
public long countDistinct(com.mysema.query.sql.SQLQuery sqlQuery)
QueryDslJdbcOperationsSQLQuery
countDistinct in interface QueryDslJdbcOperationssqlQuery - query to be used
public boolean exists(com.mysema.query.sql.SQLQuery sqlQuery)
QueryDslJdbcOperationsSQLQuery contains some rows
exists in interface QueryDslJdbcOperationssqlQuery - query to be used
public boolean notExists(com.mysema.query.sql.SQLQuery sqlQuery)
QueryDslJdbcOperationsSQLQuery is empty
notExists in interface QueryDslJdbcOperationssqlQuery - query to be used
public <T> T queryForObject(com.mysema.query.sql.SQLQuery sqlQuery,
ResultSetExtractor<T> resultSetExtractor,
com.mysema.query.types.Expression<?>... projection)
QueryDslJdbcOperationsSQLQuery. The results are mapped using the
RowMapper based on the specified projection.
queryForObject in interface QueryDslJdbcOperationssqlQuery - the SQLQuery to useresultSetExtractor - the ResultSetExtractor to extract the resultsprojection - the column projection to be used for the mapping
public <T> T queryForObject(com.mysema.query.sql.SQLQuery sqlQuery,
RowMapper<T> rowMapper,
com.mysema.query.types.Expression<?>... projection)
QueryDslJdbcOperationsSQLQuery. The results are mapped using the
RowMapper based on the specified projection.
queryForObject in interface QueryDslJdbcOperationssqlQuery - the SQLQuery to userowMapper - the RowMapper to map the resultsprojection - the column projection to be used for the mapping
public <T> T queryForObject(com.mysema.query.sql.SQLQuery sqlQuery,
com.mysema.query.types.Expression<T> expression)
QueryDslJdbcOperationsSQLQuery. The results are mapped using the
Expression which could be a QBean or a MappingProjection.
queryForObject in interface QueryDslJdbcOperationssqlQuery - the SQLQuery to useexpression - the implementation to be used for the projection/mapping
public <T> List<T> query(com.mysema.query.sql.SQLQuery sqlQuery,
ResultSetExtractor<List<T>> resultSetExtractor,
com.mysema.query.types.Expression<?>... projection)
QueryDslJdbcOperationsSQLQuery. The results are mapped using the
RowMapper based on the specified projection.
query in interface QueryDslJdbcOperationssqlQuery - the SQLQuery to useresultSetExtractor - the ResultSetExtractor to extract the resultsprojection - the column projection to be used for the mapping
public <T> List<T> query(com.mysema.query.sql.SQLQuery sqlQuery,
RowMapper<T> rowMapper,
com.mysema.query.types.Expression<?>... projection)
QueryDslJdbcOperationsSQLQuery. The results are mapped using the
RowMapper based on the specified projection.
query in interface QueryDslJdbcOperationssqlQuery - the SQLQuery to userowMapper - the RowMapper to map the resultsprojection - the column projection to be used for the mapping
public <T> List<T> query(com.mysema.query.sql.SQLQuery sqlQuery,
com.mysema.query.types.Expression<T> expression)
QueryDslJdbcOperationsSQLQuery. The results are mapped using the
Expression which could be a QBean or a MappingProjection.
query in interface QueryDslJdbcOperationssqlQuery - the SQLQuery to useexpression - the implementation to be used for the projection/mapping
public long insert(com.mysema.query.sql.RelationalPath<?> entity,
SqlInsertCallback callback)
QueryDslJdbcOperationsSqlInsertCallback.
insert in interface QueryDslJdbcOperationsentity - RelationalPath representing the table for the entitycallback - the SqlInsertCallback implementation that operates on the SQLInsertClause
public <K> K insertWithKey(com.mysema.query.sql.RelationalPath<?> entity,
SqlInsertWithKeyCallback<K> callback)
QueryDslJdbcOperationsSqlInsertWithKeyCallback.
insertWithKey in interface QueryDslJdbcOperationsentity - RelationalPath representing the table for the entitycallback - the SqlInsertWithKeyCallback implementation that operates on the SQLInsertClause
public long update(com.mysema.query.sql.RelationalPath<?> entity,
SqlUpdateCallback callback)
QueryDslJdbcOperationsSqlUpdateCallback.
update in interface QueryDslJdbcOperationsentity - RelationalPath representing the table for the entitycallback - the SqlUpdateCallback implementation that operates on the SQLUpdateClause
public long delete(com.mysema.query.sql.RelationalPath<?> entity,
SqlDeleteCallback callback)
QueryDslJdbcOperationsSqlDeleteCallback.
delete in interface QueryDslJdbcOperationsentity - RelationalPath representing the table for the entitycallback - the SqlDeleteCallback implementation that operates on the SQLDeleteClause
|
Spring Data JDBC Extensions | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||