Add Fluent API for Query Functions in Jakarta NoSQL (e.g., LEFT, UPPER, ABS, etc.) #204#223
Conversation
Introduces the Function interface with static factory methods for scalar operations (UPPER, LOWER, LEFT, RIGHT, LENGTH, ABS). Feature jakartaee#204 Signed-off-by: Matheus Oliveira <hi@omatheusmesmo.dev>
Adds a specialized exception to signal when a query function is not supported by the underlying NoSQL database provider. Feature jakartaee#204 Signed-off-by: Matheus Oliveira <hi@omatheusmesmo.dev>
Updates QueryMapper interfaces to accept Function expressions in where, and, and or clauses for SELECT, DELETE, and UPDATE queries. Feature jakartaee#204 Signed-off-by: Matheus Oliveira <hi@omatheusmesmo.dev>
Creates the Word entity and corresponding ArgumentsProvider suppliers to support compatibility testing for query functions. Feature jakartaee#204 Signed-off-by: Matheus Oliveira <hi@omatheusmesmo.dev>
Updates the AbstractTemplateTest setup to include cleanup for the new Word entity before each test execution. Feature jakartaee#204 Signed-off-by: Matheus Oliveira <hi@omatheusmesmo.dev>
Adds comprehensive TCK tests for SELECT, DELETE, and UPDATE operations using scalar functions, including numeric (ABS) and string functions. Feature jakartaee#204 Signed-off-by: Matheus Oliveira <hi@omatheusmesmo.dev>
Adds a new section to the specification documentation covering scalar functions usage and database support matrix. Feature jakartaee#204 Signed-off-by: Matheus Oliveira <hi@omatheusmesmo.dev>
|
In general, it is a good step, but I would start on the implementation, JNoSQL, where we can break and get mature, we can promote it as an API. |
Ignores temporary POM files generated by the flatten-maven-plugin. Feature jakartaee#204 Signed-off-by: Matheus Oliveira <hi@omatheusmesmo.dev>
0443dac to
5439126
Compare
@otaviojava ,
If so, should I:
Thank you for your review. |
Yeap! At the Eclipse JNoSQL, please, do it on baby-steps as well.
After testing, we can release a version and promote it to feedback. Then, finally, we can move to the spec. |
Summary
This Pull Request introduces a structured fluent API for using scalar functions in Jakarta NoSQL queries, aligning with the Jakarta Query specification. It allows developers to express richer queries with improved type safety and consistency across NoSQL providers.
Fix #204
Key Changes
1. API Core
jakarta.nosql.Function: A new interface providing static factory methods for scalar operations:UPPER(),LOWER(),LEFT(),RIGHT(),LENGTH(), andABS().jakarta.nosql.UnsupportedFunctionException: A specialized exception to signal when a specific function is not supported by the underlying database provider.jakarta.nosql.QueryMapper: Added overloads forwhere(Function),and(Function), andor(Function)acrossSELECT,DELETE, andUPDATEfluent chains.2. TCK (Compatibility Tests)
Wordentity and correspondingArgumentsProvidersuppliers.ee.jakarta.tck.nosql.functioncovering all new scalar functions.3. Documentation
spec/src/main/asciidoc/chapters/api/template.adocwith a new "Query Function Expressions" section.Example Usage
Task Checklist (from Issue #204)
Quality Assurance
mvn clean installpasses successfully.