From fe62ad2ea2c251f7135658f394505bd4058759af Mon Sep 17 00:00:00 2001 From: Robin Bygrave Date: Tue, 2 Mar 2021 15:28:17 +1300 Subject: [PATCH] #2184 - Initial refactor of DefaultOrmQuery to support 2184 - Add fetchInternal() and point fetchQuery() fetchLazy() and fetchCache() to it - Move the fetch() methods so they are located together --- .../server/querydefn/DefaultOrmQuery.java | 48 ++++++++++--------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/querydefn/DefaultOrmQuery.java b/ebean-core/src/main/java/io/ebeaninternal/server/querydefn/DefaultOrmQuery.java index 7a012d034..cd1782ad7 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/querydefn/DefaultOrmQuery.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/querydefn/DefaultOrmQuery.java @@ -1425,52 +1425,56 @@ public class DefaultOrmQuery implements SpiQuery { } @Override - public Query fetch(String property) { - return fetch(property, null, null); + public Query fetch(String path) { + return fetch(path, null, null); } @Override - public Query fetchQuery(String property) { - return fetch(property, null, FETCH_QUERY); - } - - public Query fetchCache(String property) { - return fetch(property, null, FETCH_CACHE); + public Query fetch(String path, FetchConfig joinConfig) { + return fetch(path, null, joinConfig); } @Override - public Query fetchLazy(String property) { - return fetch(property, null, FETCH_LAZY); + public Query fetch(String path, String properties) { + return fetch(path, properties, null); } @Override - public Query fetch(String property, FetchConfig joinConfig) { - return fetch(property, null, joinConfig); + public Query fetch(String path, String properties, FetchConfig config) { + return fetchInternal(path, properties, config); } @Override - public Query fetch(String property, String columns) { - return fetch(property, columns, null); + public Query fetchQuery(String path) { + return fetchInternal(path, null, FETCH_QUERY); + } + + public Query fetchCache(String path) { + return fetchInternal(path, null, FETCH_CACHE); } @Override - public Query fetchQuery(String property, String columns) { - return fetch(property, columns, FETCH_QUERY); + public Query fetchLazy(String path) { + return fetchInternal(path, null, FETCH_LAZY); } @Override - public Query fetchCache(String property, String columns) { - return fetch(property, columns, FETCH_CACHE); + public Query fetchQuery(String path, String properties) { + return fetchInternal(path, properties, FETCH_QUERY); } @Override - public Query fetchLazy(String property, String columns) { - return fetch(property, columns, FETCH_LAZY); + public Query fetchCache(String path, String properties) { + return fetchInternal(path, properties, FETCH_CACHE); } @Override - public Query fetch(String property, String columns, FetchConfig config) { - detail.fetch(property, columns, config); + public Query fetchLazy(String path, String properties) { + return fetchInternal(path, properties, FETCH_LAZY); + } + + private Query fetchInternal(String path, String properties, FetchConfig config) { + detail.fetch(path, properties, config); return this; }