DATACASS-479 - Polishing.

Use domain type via ResultProcessor as input type for PartTree instead of EntityInformation.
This commit is contained in:
Mark Paluch
2017-07-25 14:02:56 +02:00
parent 16790dc4a0
commit 9d73a0db5c
2 changed files with 12 additions and 14 deletions

View File

@@ -55,7 +55,7 @@ public class PartTreeCassandraQuery extends AbstractCassandraQuery {
super(queryMethod, operations);
this.tree = new PartTree(queryMethod.getName(), queryMethod.getEntityInformation().getJavaType());
this.tree = new PartTree(queryMethod.getName(), queryMethod.getResultProcessor().getReturnedType().getDomainType());
this.mappingContext = operations.getConverter().getMappingContext();
this.statementFactory = new StatementFactory(new UpdateMapper(operations.getConverter()));
}
@@ -97,8 +97,7 @@ public class PartTreeCassandraQuery extends AbstractCassandraQuery {
@Override
protected Statement createQuery(CassandraParameterAccessor parameterAccessor) {
CassandraQueryCreator queryCreator =
new CassandraQueryCreator(getTree(), parameterAccessor, getMappingContext());
CassandraQueryCreator queryCreator = new CassandraQueryCreator(getTree(), parameterAccessor, getMappingContext());
Query query = queryCreator.createQuery();
@@ -108,14 +107,14 @@ public class PartTreeCassandraQuery extends AbstractCassandraQuery {
query = query.limit(getTree().getMaxResults());
}
if (getQueryMethod().getQueryAnnotation()
.map(org.springframework.data.cassandra.repository.Query::allowFiltering).orElse(false)) {
if (getQueryMethod().getQueryAnnotation().map(org.springframework.data.cassandra.repository.Query::allowFiltering)
.orElse(false)) {
query = query.withAllowFiltering();
}
CassandraPersistentEntity<?> persistentEntity =
getMappingContext().getRequiredPersistentEntity(getQueryMethod().getDomainClass());
CassandraPersistentEntity<?> persistentEntity = getMappingContext()
.getRequiredPersistentEntity(getQueryMethod().getDomainClass());
return getStatementFactory().select(query, persistentEntity);

View File

@@ -55,7 +55,7 @@ public class ReactivePartTreeCassandraQuery extends AbstractReactiveCassandraQue
super(queryMethod, operations);
this.tree = new PartTree(queryMethod.getName(), queryMethod.getEntityInformation().getJavaType());
this.tree = new PartTree(queryMethod.getName(), queryMethod.getResultProcessor().getReturnedType().getDomainType());
this.mappingContext = operations.getConverter().getMappingContext();
this.statementFactory = new StatementFactory(new UpdateMapper(operations.getConverter()));
}
@@ -97,8 +97,7 @@ public class ReactivePartTreeCassandraQuery extends AbstractReactiveCassandraQue
@Override
protected Statement createQuery(CassandraParameterAccessor parameterAccessor) {
CassandraQueryCreator queryCreator =
new CassandraQueryCreator(getTree(), parameterAccessor, getMappingContext());
CassandraQueryCreator queryCreator = new CassandraQueryCreator(getTree(), parameterAccessor, getMappingContext());
Query query = queryCreator.createQuery();
@@ -108,14 +107,14 @@ public class ReactivePartTreeCassandraQuery extends AbstractReactiveCassandraQue
query = query.limit(getTree().getMaxResults());
}
if (getQueryMethod().getQueryAnnotation()
.map(org.springframework.data.cassandra.repository.Query::allowFiltering).orElse(false)) {
if (getQueryMethod().getQueryAnnotation().map(org.springframework.data.cassandra.repository.Query::allowFiltering)
.orElse(false)) {
query = query.withAllowFiltering();
}
CassandraPersistentEntity<?> persistentEntity =
getMappingContext().getRequiredPersistentEntity(getQueryMethod().getDomainClass());
CassandraPersistentEntity<?> persistentEntity = getMappingContext()
.getRequiredPersistentEntity(getQueryMethod().getDomainClass());
return getStatementFactory().select(query, persistentEntity);