private class CassandraQueryLookupStrategy implements QueryLookupStrategy {
@Override
public RepositoryQuery resolveQuery(Method method, RepositoryMetadata metadata, NamedQueries namedQueries) {
CassandraQueryMethod queryMethod = new CassandraQueryMethod(method, metadata, mappingContext);
String namedQueryName = queryMethod.getNamedQueryName();
if (namedQueries.hasQuery(namedQueryName)) {
String namedQuery = namedQueries.getQuery(namedQueryName);
return new StringBasedCassandraQuery(namedQuery, queryMethod, cassandraTemplate);
} else if (queryMethod.hasAnnotatedQuery()) {
return new StringBasedCassandraQuery(queryMethod, cassandraTemplate);
} else {
throw new InvalidDataAccessApiUsageException("declarative query methods are a todo");
}
}