moqui / moqui-framework

Use Moqui Framework to build enterprise applications based on Java. It includes tools for databases (relational, graph, document), local and web services, web and other UI with screens and forms, security, file/resource access, scripts, templates, l10n, caching, logging, search, rules, workflow, multi-instance, and integration.
http://www.moqui.org
Other
284 stars 204 forks source link

migration from 1.6 to 2.1: sqlFind #309

Open I-Leonov opened 6 years ago

I-Leonov commented 6 years ago

We're trying to migrate our code from moqui 1.6 to 2.1

We have complex SQL queries that were executed via sqlFind() method. I see that in 1.6.2 version the method was changed - now it requires that sqlParameterList and fieldList must not be null and must be the same size.

We have following scenarios:

  1. In some queries we don't have params at all (or we have for ex. 3 params and 5 fields to select)
  2. We have IN conditions (so it's actually a list of params per field)
  3. We have conditions in subqueries (so we can't have them in fieldList at all)

How can we handle this in moqui v2.1?

jonesde commented 6 years ago

There is certainly room for improvement in EntityFacade.sqlFind(). With enhancements to view entities and such it just isn't used much, in fact I have yet to use it once nor worked on any development or developer support contracts where it was used. There aren't even any test cases for it. Basically it's old and neglected.

If you want to see this improved your best bet is to submit Spock tests that can run with the existing framework tests, and using the same test entities and such used elsewhere. A pull request with proposed changes would also improve chances of something happening with this (ie that I or another contributor would work on it including development, review, testing, etc).

jonesde commented 6 years ago

BTW, issues should be submitted on the new HiveMind instance on moqui.org. I haven't turned off issues on GitHub for moqui-framework yet but will sooner or later. See more information at:

https://www.moqui.org/m/docs/moqui/Issue+and+Pull+Request+Guide

https://www.moqui.org/m/docs/moqui/Community+Guide