mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-25 15:18:59 +00:00
#1436 - PersistenceException: Query threw SQLException:No ScalarType registered for class java.util.Arrays$ArrayList Query was:select id, name from o_customer where id = any(?)
This commit is contained in:
1 parent
a5a8765bd0
commit
dd8607b072
3 files changed
+67
-1
No files matched your search
@@ -1,5 +1,7 @@
|
||||
package io.ebean;
|
||||
|
||||
import io.ebean.annotation.ForPlatform;
|
||||
import io.ebean.annotation.Platform;
|
||||
import io.ebean.meta.BasicMetricVisitor;
|
||||
import io.ebean.meta.MetaQueryMetric;
|
||||
import org.ebeantest.LoggedSqlCollector;
|
||||
@@ -8,6 +10,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.tests.model.basic.ResetBasicData;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@@ -98,6 +101,48 @@ public class DtoQueryTest extends BaseTestCase {
|
||||
}
|
||||
|
||||
|
||||
@ForPlatform(Platform.POSTGRES)
|
||||
@Test
|
||||
public void dto_bindList_usingPostrgesAnyWithPositionedParameter() {
|
||||
|
||||
ResetBasicData.reset();
|
||||
|
||||
List<Integer> ids = Arrays.asList(1, 2);
|
||||
|
||||
List<DCust> list = server().findDto(DCust.class, "select id, name from o_customer where id = any(?)")
|
||||
.setParameter(1, ids)
|
||||
.findList();
|
||||
|
||||
assertThat(list).isNotEmpty();
|
||||
|
||||
list = server().findDto(DCust.class, "select id, name from o_customer where id in (:idList)")
|
||||
.setParameter("idList", ids)
|
||||
.findList();
|
||||
|
||||
assertThat(list).isNotEmpty();
|
||||
}
|
||||
|
||||
@ForPlatform(Platform.POSTGRES)
|
||||
@Test
|
||||
public void sql_bindListParam_usingPostrgesAnyWithPositionedParameter() {
|
||||
|
||||
ResetBasicData.reset();
|
||||
|
||||
List<Integer> ids = Arrays.asList(1, 2);
|
||||
|
||||
List<SqlRow> list = server().createSqlQuery("select id, name from o_customer where id = any(?)")
|
||||
.setParameter(1, ids)
|
||||
.findList();
|
||||
|
||||
assertThat(list).isNotEmpty();
|
||||
|
||||
list = server().createSqlQuery("select id, name from o_customer where id in (:idList)")
|
||||
.setParameter("idList", ids)
|
||||
.findList();
|
||||
|
||||
assertThat(list).isNotEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void dto_queryPlanHits() {
|
||||
|
||||
|
||||
Reference in new issue
Block a user