mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#1499 - findNative with findIds (or findSingleAttributeList with id property) throws ArrayIndexOutOfBoundsException
This commit is contained in:
@@ -148,7 +148,10 @@ class SqlTreeNodeBean implements SqlTreeNode {
|
||||
public ScalarType<?> getSingleAttributeScalarType() {
|
||||
if (properties == null || properties.length == 0) {
|
||||
// if we have no property ask first children (in a distinct select with join)
|
||||
// if we have also no children, NPE happens anyway.
|
||||
if (children.length == 0) {
|
||||
// expected to be a findIds query
|
||||
return desc.getIdBinder().getBeanProperty().getScalarType();
|
||||
}
|
||||
return children[0].getSingleAttributeScalarType();
|
||||
}
|
||||
if (properties[0] instanceof STreePropertyAssocOne) {
|
||||
|
||||
@@ -769,6 +769,7 @@ public class DefaultOrmQuery<T> implements SpiQuery<T> {
|
||||
copy.mapKey = mapKey;
|
||||
copy.id = id;
|
||||
copy.label = label;
|
||||
copy.nativeSql = nativeSql;
|
||||
copy.useBeanCache = useBeanCache;
|
||||
copy.useQueryCache = useQueryCache;
|
||||
copy.readOnly = readOnly;
|
||||
|
||||
Reference in New Issue
Block a user