Search in sources :

Example 1 with UpdateMapper

use of org.springframework.data.cassandra.core.convert.UpdateMapper in project spring-data-cassandra by spring-projects.

the class CassandraQueryCreatorUnitTests method createQuery.

private String createQuery(String source, Class<?> entityClass, Object... values) {
    PartTree tree = new PartTree(source, entityClass);
    CassandraQueryCreator creator = new CassandraQueryCreator(tree, getAccessor(converter, values), context);
    StatementFactory factory = new StatementFactory(new UpdateMapper(converter));
    Query query = creator.createQuery();
    SimpleStatement statement = factory.select(query, context.getRequiredPersistentEntity(entityClass)).build(StatementBuilder.ParameterHandling.INLINE, CodecRegistry.DEFAULT);
    return statement.getQuery();
}
Also used : Query(org.springframework.data.cassandra.core.query.Query) SimpleStatement(com.datastax.oss.driver.api.core.cql.SimpleStatement) StatementFactory(org.springframework.data.cassandra.core.StatementFactory) PartTree(org.springframework.data.repository.query.parser.PartTree) UpdateMapper(org.springframework.data.cassandra.core.convert.UpdateMapper)

Aggregations

SimpleStatement (com.datastax.oss.driver.api.core.cql.SimpleStatement)1 StatementFactory (org.springframework.data.cassandra.core.StatementFactory)1 UpdateMapper (org.springframework.data.cassandra.core.convert.UpdateMapper)1 Query (org.springframework.data.cassandra.core.query.Query)1 PartTree (org.springframework.data.repository.query.parser.PartTree)1