mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-02 11:17:40 +08:00
NPE if a query contains more than one parameter with implicitConversion disabled #1163
This commit is contained in:
parent
6d708bf663
commit
eca568b595
@ -152,4 +152,18 @@ class DataManagerTest extends Specification {
|
||||
noExceptionThrown()
|
||||
count > 0
|
||||
}
|
||||
|
||||
def "more than one parameter without implicit conversion #1163"() {
|
||||
|
||||
when:
|
||||
|
||||
LoadContext.Query query = LoadContext.createQuery('select e from test$Foo e where e.ref1 = :ref1 and e.ref2 = :ref2')
|
||||
.setParameter('ref1', 'val1', false)
|
||||
.setParameter('ref2', 'val2', false)
|
||||
.setParameter('ref3', 'val3', false)
|
||||
|
||||
then:
|
||||
|
||||
query.getNoConversionParams() == ['ref1', 'ref2', 'ref3'].toArray(new String[0])
|
||||
}
|
||||
}
|
||||
|
@ -367,7 +367,7 @@ public class LoadContext<E extends Entity> implements DataLoadContext, Serializa
|
||||
// this is a rare case, so let's save some memory by using an array instead of a list
|
||||
if (noConversionParams == null)
|
||||
noConversionParams = new String[0];
|
||||
noConversionParams = new String[noConversionParams.length + 1];
|
||||
noConversionParams = Arrays.copyOfRange(noConversionParams, 0, noConversionParams.length + 1);
|
||||
noConversionParams[noConversionParams.length - 1] = name;
|
||||
}
|
||||
return this;
|
||||
|
Loading…
Reference in New Issue
Block a user