From ab87174e5b2d1ab111061eac49fc2b7e5f8bf700 Mon Sep 17 00:00:00 2001 From: rob bygrave Date: Sun, 14 Feb 2021 11:30:24 +1300 Subject: [PATCH] #2163 - Fix OrmQueryProperties when FetchConfig null --- .../server/querydefn/OrmQueryProperties.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/querydefn/OrmQueryProperties.java b/ebean-core/src/main/java/io/ebeaninternal/server/querydefn/OrmQueryProperties.java index 554992214..704cead7f 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/querydefn/OrmQueryProperties.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/querydefn/OrmQueryProperties.java @@ -84,18 +84,22 @@ public class OrmQueryProperties implements Serializable { } public OrmQueryProperties(String path, String rawProperties) { - this(path, rawProperties, null); + this(path, rawProperties, DEFAULT_FETCH); } public OrmQueryProperties(String path, String rawProperties, FetchConfig fetchConfig) { this.path = path; this.parentPath = SplitName.parent(path); - OrmQueryPropertiesParser.Response response = OrmQueryPropertiesParser.parse(rawProperties); this.properties = response.properties; this.included = response.included; - this.fetchConfig = fetchConfig != null ? fetchConfig : DEFAULT_FETCH; - this.cache = fetchConfig.isCache(); + if (fetchConfig != null) { + this.fetchConfig = fetchConfig; + this.cache = fetchConfig.isCache(); + } else { + this.cache = false; + this.fetchConfig = DEFAULT_FETCH; + } } public OrmQueryProperties(String path, Set included) {