Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-11203

get Delegator instance without calling `main`

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: Trunk
    • Fix Version/s: Upcoming Branch
    • Component/s: framework
    • Labels:
      None

      Description

      I'd like to run a groovy script to make some database queries without running a full ofbiz server. Something like the following

      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 ?

        Attachments

        1. start-setconfig.patch
          0.7 kB
          Samuel Trégouët

          Activity

            People

            • Assignee:
              mthl Mathieu Lirzin
              Reporter:
              stregouet Samuel Trégouët
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: