JPQL IN CLAUSE not working as expected

This is always returning []. Am i missing something?

List<Jazdy> jazdy = <<<there is some Jazdy.class list>>>;

List<Jazdy> jazdicky = dataManager.load(Jazdy.class)
                .query("select j from doprava_Jazdy j where j in :jazdy")
                .parameter("jazdy",jazdy)
                .view("jazdy-view")
                .list();

jazdicky returns []

Hi, @igor.sovcik!

Your code and JPQL statement seems correct and should work. You could set eclipselink.sql logger to DEBUG to see executed SQL queries in app.log using Administration > Server log screen, or edit logback.xml and restart Tomcat (Documentation). It may help to understand what goes wrong.

Regards,
Sergey

@s.fedorov thank you for tip. Unfortunatelly there was no usefull information in logs. I had to overcome it somehow.

List<Jazdy> jazdy = <<<there is some Jazdy.class list>>>;

List<UUID> uids = new ArrayList<UUID>();

 jazdy.forEach(jazd -> {
            uids.add(jazd.getUuid()) ;
 });

List<Jazdy> jazdicky = dataManager.load(Jazdy.class)
                .query("select j from doprava_Jazdy j where j.id in :uids ")
                .parameter("uids ",uids )
                .view("jazdy-view")
                .list();
1 Like