Internal refactor / tidy - Suggestions from intellij code analysis. (#1209)

This commit is contained in:
Koen De Groote authored and Rob Bygrave committed 2017-11-14 18:19:38 +13:00
1 parent 0056568bc7
commit f1ebe7929b
29 files changed
+66 -59

No files matched your search

@@ -31,8 +31,8 @@ public class SqlBeanLoad {
this.ctx = ctx;
this.rawSql = ctx.isRawSql();
this.type = type;
this.lazyLoading = queryMode.equals(Mode.LAZYLOAD_BEAN);
this.refreshLoading = queryMode.equals(Mode.REFRESH_BEAN);
this.lazyLoading = queryMode == Mode.LAZYLOAD_BEAN;
this.refreshLoading = queryMode == Mode.REFRESH_BEAN;
this.bean = bean;
this.ebi = bean == null ? null : bean._ebean_getIntercept();
}
@@ -110,7 +110,7 @@ public final class SqlTreeBuilder {
this.query = request.getQuery();
this.temporalMode = SpiQuery.TemporalMode.of(query);
this.disableLazyLoad = query.isDisableLazyLoading();
this.subQuery = Type.SUBQUERY.equals(query.getType()) || Type.ID_LIST.equals(query.getType());
this.subQuery = Type.SUBQUERY == query.getType() || Type.ID_LIST == query.getType();
this.includeJoin = query.getM2mIncludeJoin();
this.manyWhereJoins = query.getManyWhereJoins();
this.queryDetail = query.getDetail();
@@ -308,7 +308,7 @@ class SqlTreeNodeBean implements SqlTreeNode {
}
boolean lazyLoadMany = false;
if (localBean == null && queryMode.equals(Mode.LAZYLOAD_MANY)) {
if (localBean == null && queryMode == Mode.LAZYLOAD_MANY) {
// batch lazy load many into existing contextBean
localBean = contextBean;
lazyLoadMany = true;
@@ -321,7 +321,7 @@ class SqlTreeNodeBean implements SqlTreeNode {
aChildren.load(ctx, localBean, contextBean);
}
if (queryMode.equals(Mode.LAZYLOAD_MANY) && isRoot()) {
if (queryMode == Mode.LAZYLOAD_MANY && isRoot()) {
return contextBean;
}
@@ -337,7 +337,7 @@ class SqlTreeNodeBean implements SqlTreeNode {
EntityBeanIntercept ebi = localBean._ebean_getIntercept();
ebi.setPersistenceContext(persistenceContext);
if (Mode.LAZYLOAD_BEAN.equals(queryMode)) {
if (Mode.LAZYLOAD_BEAN == queryMode) {
// Lazy Load does not reset the dirty state
ebi.setLoadedLazy();
} else if (readId) {