public class SpannerStatementQueryExecutor extends Object
PartTree
parsed method
definitions.Constructor and Description |
---|
SpannerStatementQueryExecutor() |
Modifier and Type | Method and Description |
---|---|
static void |
buildOrderBy(SpannerPersistentEntity<?> persistentEntity,
StringBuilder stringBuilder,
org.springframework.data.domain.Sort sort) |
static com.google.cloud.spanner.Statement |
buildStatementFromSqlWithArgs(String sql,
List<String> tags,
Object[] params)
Creates a Spanner statement.
|
static Object |
executeQuery(Class type,
org.springframework.data.repository.query.parser.PartTree tree,
Object[] params,
SpannerOperations spannerOperations,
SpannerMappingContext spannerMappingContext)
Executes a PartTree-based query.
|
public static Object executeQuery(Class 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 void buildOrderBy(SpannerPersistentEntity<?> persistentEntity, StringBuilder stringBuilder, org.springframework.data.domain.Sort sort)
Copyright © 2018 Pivotal Software, Inc.. All rights reserved.