public class SpannerStatementQueryExecutor extends Object
PartTree parsed method
definitions.| Constructor and Description |
|---|
SpannerStatementQueryExecutor() |
| Modifier and Type | Method and Description |
|---|---|
static StringBuilder |
applySort(org.springframework.data.domain.Sort sort,
StringBuilder sql,
Function<org.springframework.data.domain.Sort.Order,String> sortedPropertyNameFunction) |
static com.google.cloud.spanner.Statement |
buildStatementFromSqlWithArgs(String sql,
List<String> tags,
Object[] params)
Creates a Spanner statement.
|
static <T> List<T> |
executeQuery(Class<T> type,
org.springframework.data.repository.query.parser.PartTree tree,
Object[] params,
SpannerOperations spannerOperations,
SpannerMappingContext spannerMappingContext)
Executes a PartTree-based query.
|
public static <T> List<T> executeQuery(Class<T> type, org.springframework.data.repository.query.parser.PartTree tree, Object[] params, SpannerOperations spannerOperations, SpannerMappingContext spannerMappingContext)
type - the type of the underlying entitytree - the parsed metadata of the queryparams - the parameters of this specific queryspannerOperations - used to execute the queryspannerMappingContext - used to get metadata about the entity typeUnsupportedOperationException - for DELETE queries.public static com.google.cloud.spanner.Statement buildStatementFromSqlWithArgs(String sql, List<String> tags, Object[] params)
sql - the SQL string with tags.tags - the tags that appear in the SQL string.params - the parameters to substitute the tags. The ordering must be the same
as the tags.IllegalArgumentException - if the number of tags does not match the number of
params, or if a param of an unsupported type is given.public static StringBuilder applySort(org.springframework.data.domain.Sort sort, StringBuilder sql, Function<org.springframework.data.domain.Sort.Order,String> sortedPropertyNameFunction)
Copyright © 2018 Pivotal Software, Inc.. All rights reserved.