Используя @Query из org.springframework.data.cassandra.repository.Query, я хотел бы сделать собственный запрос и передать его в мой репозиторий, а затем из параметра в аннотацию @Query.
Мой репозиторий выглядит так:
@Repository
public interface TestRepository extends CassandraRepository<TestValues, id> {
@Query(value = ":customQuery")
public List<TestValues> testSearch(@Param("customQuery") String customQuery);
}
Где String customQuery - это сам запрос. Например, "SELECT * FROM TABLE_A WHERE COLUMN_B = C"
я получаю следующую ошибку:
ERROR o.a.c.c.C.[.[.[.[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.data.cassandra.CassandraQuerySyntaxException: Query; CQL [{{customQuery}}]; line 1:0 no viable alternative at input '{' ([{]...); nested exception is com.datastax.driver.core.exceptions.SyntaxError: line 1:0 no viable alternative at input '{' ([{]...)] with root cause
com.datastax.driver.core.exceptions.SyntaxError: line 1:0 no viable alternative at input '{' ([{]...)
Я предполагаю, что customQuery - это строка с кавычками "". Но я не знаю, как передать весь запрос таким образом. Может ли кто-нибудь помочь мне? :)