I have method for search some object in postgre database:
private final EntityManager entityManager;
public Stream<Tuple> findTest1Set(Integer id,
List<String> statuses,
String filter,
String type,
Integer id2) {
return entityManager.unwrap(Session.class)
.createNativeQuery(sql, Tuple.class)
.setParameter("id", id)
.setParameter("statuses", statuses)
.getResultStream()
}
And some sql:
select
*
from earp.as sys
where
(sys.id = :id or sys.parent_id = :id)
and (coalesce(statuses) is null
or (sys.status not in (:statuses))
)
And structure:
create table as
(
id integer default nextval('id_seq'::regclass) not null primary key,
status as_status_type not null
);
and:
create type as_status_type as enum ('CANCELLED', 'UNKNOWN');
And I get the error: ERROR o.h.e.jdbc.spi.SqlExceptionHelper - ERROR: could not determine the data type of parameter $3
Who I can fix it? In hibernate 5 all was be ok I try other cast, but it's not work for my