Improve Refactor internals OrmQueryProperties invert isEmpty()

Rename to hasProperties() and improve javadoc
This commit is contained in:
robin committed 2021-02-16 23:20:44 +13:00
1 parent e5ec72df5c
commit de439e7695
2 files changed
+5 -9

No files matched your search

@@ -111,7 +111,7 @@ public class OrmQueryDetail implements Serializable {
*/
public String asStringDebug() {
StringBuilder sb = new StringBuilder();
if (baseProps.notEmpty()) {
if (baseProps.hasProperties()) {
baseProps.asStringDebug("select ", sb);
}
if (fetchPaths != null) {
@@ -214,7 +214,7 @@ public class OrmQueryProperties implements Serializable {
*/
@SuppressWarnings("unchecked")
public void configureBeanQuery(SpiQuery<?> query) {
if (notEmpty()) {
if (hasProperties()) {
query.selectProperties(this);
}
@@ -242,17 +242,13 @@ public class OrmQueryProperties implements Serializable {
}
public boolean hasSelectClause() {
if (allProperties) {
return true;
}
// explicitly selected some properties
return included != null || filterMany != null;
return allProperties || included != null || filterMany != null;
}
/**
* Return true if the properties and configuration are empty.
* Return true if explicit properties have been specified.
*/
boolean notEmpty() {
boolean hasProperties() {
return allProperties || included != null;
}