Ошибка Кассандры: ожидается 8 или 0 байт для даты - PullRequest
3 голосов
/ 18 июня 2019

Я использую данные весны Cassandra

Мой этот код работает

@Query("SELECT count(*) as cnt FROM notifications where userid = ?0 and typeofnotification=?1  "
            + "and notificationId > minTimeuuid('2019-09-12') and category = ?3 allow filtering")

    public Integer findCountForCategoryForDate(int userId, String typeOfNotification, String category);

Но когда я пытаюсь дать дату в качестве параметра, он выдает ошибку

@Query("SELECT count(*) as cnt FROM notifications where userid = ?0 and typeofnotification=?1  "
            + "and notificationId > minTimeuuid(?2) and category = ?3 allow filtering")

public Integer findCountForCategoryForDate(int userId, String typeOfNotification,String date, String category);

Чего мне не хватает?

В столбце messagesID указан timeuuid в БД

1 Ответ

3 голосов
/ 18 июня 2019

функция mintimeuuid ожидает отметку времени в качестве параметра, но вы передаете строку. Вместо этого вам нужно передать переменную типа java.util.Date. См. документацию для сопоставления между типом Java и типами CQL .

...