From 8aa27e3b4d08c0471c201fc83fd494399b1586d7 Mon Sep 17 00:00:00 2001 From: MLeila Date: Mon, 13 May 2024 18:06:42 +0200 Subject: [PATCH] Fixed: Error when calling EntityQuery.from() with a dve via groovy DSL (OFBIZ-13077) This add the Groovy DSL for EntityQuery.from(DynamicViewEntity dve) --- .../apache/ofbiz/service/engine/GroovyBaseScript.groovy | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/framework/service/src/main/groovy/org/apache/ofbiz/service/engine/GroovyBaseScript.groovy b/framework/service/src/main/groovy/org/apache/ofbiz/service/engine/GroovyBaseScript.groovy index 5351b744bb1..fa7c9bae5ac 100644 --- a/framework/service/src/main/groovy/org/apache/ofbiz/service/engine/GroovyBaseScript.groovy +++ b/framework/service/src/main/groovy/org/apache/ofbiz/service/engine/GroovyBaseScript.groovy @@ -21,6 +21,7 @@ package org.apache.ofbiz.service.engine import org.apache.ofbiz.base.util.Debug import org.apache.ofbiz.base.util.UtilProperties import org.apache.ofbiz.entity.GenericValue +import org.apache.ofbiz.entity.model.DynamicViewEntity import org.apache.ofbiz.entity.util.EntityQuery import org.apache.ofbiz.service.DispatchContext import org.apache.ofbiz.service.ExecutionServiceException @@ -90,8 +91,12 @@ abstract class GroovyBaseScript extends Script { return binding.getVariable('delegator').makeValidValue(entityName, inputMap) } - EntityQuery from(String entity) { - return EntityQuery.use(binding.getVariable('delegator')).from(entity) + EntityQuery from(String entityName) { + return EntityQuery.use(binding.getVariable('delegator')).from(entityName) + } + + EntityQuery from(DynamicViewEntity dynamicViewEntity) { + return EntityQuery.use(binding.getVariable('delegator')).from(dynamicViewEntity) } EntityQuery select(String... fields) {