ofbiz-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Samuel Trégouët (Jira) <j...@apache.org>
Subject [jira] [Updated] (OFBIZ-11203) get Delegator instance without calling `main`
Date Wed, 18 Sep 2019 09:12:00 GMT

     [ https://issues.apache.org/jira/browse/OFBIZ-11203?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Samuel Trégouët updated OFBIZ-11203:
------------------------------------
    Attachment: start-setconfig.patch

> get Delegator instance without calling `main`
> ---------------------------------------------
>
>                 Key: OFBIZ-11203
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-11203
>             Project: OFBiz
>          Issue Type: Improvement
>            Reporter: Samuel Trégouët
>            Priority: Major
>         Attachments: start-setconfig.patch
>
>
> I'd like to run a groovy script to make some database queries without running a full
ofbiz server. Something like the following
>  
> ```groovy
> {{}}
> Delegator d = getDelegator("default")println("will make call on database")def result
= EntityQuery.use(d).from("Product").queryList()println(result)
> ```
>  
> But to do so I need to call `ComponentContainer.init` which retrieve `Config` from `Start`
singleton. So to make my use case work I only need a public `setConfig` method on `Start`
class, is this ok for you ?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message