mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-08 08:39:19 +00:00
#980 - fix several bugs in findSingleAttibute - Refactor moving logic into DefaultOrmQuery setDefaultSelectClause() from findSingleAttributeList() (to support alternate calling via EbeanServer)
This commit is contained in:
1 parent
a46e086dc4
commit
0e2900d796
4 files changed
+38
-11
No files matched your search
@@ -513,7 +513,12 @@ public class DefaultOrmQuery<T> implements SpiQuery<T> {
|
||||
|
||||
@Override
|
||||
public void setDefaultSelectClause() {
|
||||
detail.setDefaultSelectClause(beanDescriptor);
|
||||
if (type != Type.ATTRIBUTE) {
|
||||
detail.setDefaultSelectClause(beanDescriptor);
|
||||
} else if (!detail.hasSelectClause()) {
|
||||
// explicit empty select when single attribute query on non-root fetch path
|
||||
detail.setEmptyBase();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1221,10 +1226,6 @@ public class DefaultOrmQuery<T> implements SpiQuery<T> {
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <A> List<A> findSingleAttributeList() {
|
||||
if (!detail.hasSelectClause()) {
|
||||
// (no explicit select set - clear all properties)
|
||||
detail.setBase(new OrmQueryProperties(null, new LinkedHashSet<>()));
|
||||
}
|
||||
return (List<A>) server.findSingleAttributeList(this, null);
|
||||
}
|
||||
|
||||
|
||||
@@ -174,6 +174,13 @@ public class OrmQueryDetail implements Serializable {
|
||||
return baseProps.isIncluded(property);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the base query properties to be empty.
|
||||
*/
|
||||
public void setEmptyBase() {
|
||||
this.baseProps = new OrmQueryProperties(null, new LinkedHashSet<>());
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the base / root query properties.
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user