Skip to content

feat: add Function interface and UnsupportedFunctionException to mapping layer#712

Merged
otaviojava merged 4 commits into
eclipse-jnosql:mainfrom
omatheusmesmo:feat/643-function-api
Apr 2, 2026
Merged

feat: add Function interface and UnsupportedFunctionException to mapping layer#712
otaviojava merged 4 commits into
eclipse-jnosql:mainfrom
omatheusmesmo:feat/643-function-api

Conversation

@omatheusmesmo
Copy link
Copy Markdown

Description

Adds Function and UnsupportedFunctionException to the semistructured mapping layer as pure type definitions — no grammar changes, no fluent API wiring, no mapper integration. Just the types that the next PRs will use.

Step 1 of 3 from the PR #704 split, as requested by @otaviojava and @dearrudam.

Related Issue: Related to #643

Type of Contribution

  • Bug fix
  • Feature request
  • New database support
  • Use case implementation
  • Documentation update
  • Other:

Architectural and Design Decisions

  • Function is a public interface in org.eclipse.jnosql.mapping.semistructured with static factory methods (upper, lower, left, right, length, abs).
  • DefaultFunction is a package-private record in its own file, following the project's convention for Default* implementations (and Otávio's feedback on PR Support for Function Expressions in JDQL and Fluent API (#643) #704).
  • UnsupportedFunctionException extends MappingException (unchecked) so database drivers can signal unsupported functions without forcing checked exceptions on callers.

Contribution Checklist

  • ECA: I have signed the Eclipse Contributor Agreement.
  • DCO: All my commits are signed with Signed-off-by (git commit -s).
  • Conventional Commits: I followed the Conventional Commits pattern.
  • Tests: I have added/updated unit and integration tests.
  • Documentation: I have updated the relevant .adoc files.
  • Verification: I have run mvn clean verify and it passed successfully.

Validation Results

mvn -B clean install
BUILD SUCCESS (JDK 21)

Matheus Oliveira added 4 commits March 31, 2026 22:18
Introduces the Function interface in the mapping semistructured layer to
represent function expressions (e.g., ABS, LENGTH, UPPER). This is part
of the Jakarta Data function expression support (issue eclipse-jnosql#643).

DefaultFunction is a package-private record following the project
convention for Default* implementations.

Signed-off-by: Matheus Oliveira <hi@omatheusmesmo.dev>
Adds UnsupportedFunctionException, a runtime exception thrown when a
NoSQL database provider does not support a given function expression.

Signed-off-by: Matheus Oliveira <hi@omatheusmesmo.dev>
Covers factory methods, equality, toString, and edge cases for the
Function interface.

Signed-off-by: Matheus Oliveira <hi@omatheusmesmo.dev>
Covers message propagation and exception behavior for
UnsupportedFunctionException.

Signed-off-by: Matheus Oliveira <hi@omatheusmesmo.dev>
*
* @return the field name, never {@code null}
*/
String field();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In generatl we are using more the term attribute, but I don't have strong feelings on this one.

@otaviojava otaviojava merged commit d96220d into eclipse-jnosql:main Apr 2, 2026
3 checks passed
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