Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add possibility of creating arbitrary queries on DBManager #154

Merged
merged 2 commits into from
May 21, 2020

Conversation

alcarraz
Copy link
Contributor

@alcarraz alcarraz commented May 13, 2020

Arbitrary query over the entity type (T) of this manager
Example usage:

GLTransactionManager mgr = new GLtransactionManager(db);
List<T> results = mgr.queryItems(true, (cb, root) ->
              cb.or(
                  cb.greaterThanOrEqualTo(root.get("postDate"), someDate),
                  cb.isNull(root.get("postDate")
              )
         );

Andrés Alcarraz added 2 commits May 13, 2020 18:55
So they can be not final and overridden by subclasses, also more efficient than the auto creation of the array for a single argument.
@alcarraz alcarraz force-pushed the feature/dbmanager-query-with-predicates branch from 0cec325 to 55bb41c Compare May 16, 2020 00:33
@ar ar merged commit 1691f83 into jpos:master May 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants