feat: add GROUP BY, HAVING and Query/AdvancedQuery separation by vage88sg1 · Pull Request #143 · queritylib/querity

Add support for GROUP BY and HAVING clauses with a clear separation
between simple entity queries and projection queries.

API Changes:
- Query: simplified for entity-only queries (filter, sort, pagination, distinct)
- AdvancedQuery: for projections with SELECT, GROUP BY, HAVING clauses
- QueryDefinition: common interface for both query types
- Querity.advancedQuery(): new entry point for projection queries
- Querity.findAllProjected(): returns List<Map<String, Object>>

New Features:
- GROUP BY with property names or expressions
- HAVING clause for aggregate filtering
- AdvancedQueryPreprocessor for preprocessing advanced queries
- JpaQueryUtils to reduce code duplication

Implementation:
- JPA, MongoDB, Elasticsearch backend support
- Parser support for GROUP BY and HAVING
- Semantic validation (HAVING requires GROUP BY)
- Null validation in withPreprocessor() methods
- Immutable preprocessors list using List.copyOf()
- Standardized exception handling across all factories

brunomendola

requested changes Jan 15, 2026

- Update README examples to use advancedQuery() for projections and GROUP BY
- Add MockMvc integration tests for AdvancedQuery JSON binding
- Allow mixing propertyNames and expressions in SimpleGroupBy and SimpleSelect
- Add .factorypath to .gitignore
- Remove FUNCTION shorthand from ConditionDeserializer as it was untested
  and could cause issues with field mixing
- Keep explicit leftExpression format which is properly tested
- Document getEffectiveExpressions() ordering behavior in SimpleGroupBy
  and SimpleSelect Javadoc to clarify that propertyNames come before
  expressions, and interleaved insertion order is not preserved