Я использую spring-data-jpa
для реляционного сопоставления объектов с пружинной загрузкой и postgreSql, и написал собственный метод для получения различимого значения столбца task_id
при совпадении с условием
@Query(value = "select distinct task_id from schema_task_test.test_table where type =:type", nativeQuery = true)
public List<Integer> findDistinctTasks(@Param("type") String type);
Но в базе данных type
имеет тип Enum
, поэтому я получаю исполнение
Error
[ERROR] 2019-03-19 16:33:45,006 http-nio-8080-exec-1 org.hibernate.engine.jdbc.spi.SqlExceptionHelper - {} - ERROR: operator does not exist: schema_task_test.type_enum = character varying
Hint: No operator matches the given name and argument types. You might need to add explicit type casts.