Error message when Embeddable has a missing field name rather than th…#3803
Open
DakshRJain737 wants to merge 1 commit into
Open
Error message when Embeddable has a missing field name rather than th…#3803DakshRJain737 wants to merge 1 commit into
DakshRJain737 wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Improves Micronaut Data SQL entity mapping error reporting for embeddables by surfacing the specific null embedded field (as a dotted path) instead of only the embedded object name.
Changes:
- Added
EmbeddableNullFieldExceptionto carry an embedded-property path and produce a more specific null-field message. - Updated
SqlResultEntityTypeMapperto throw this exception when an@Embeddable/@EmbeddedIdconstructor argument is null, and to prefix nested embeddable paths when rethrowing.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| data-runtime/src/main/java/io/micronaut/data/runtime/mapper/sql/SqlResultEntityTypeMapper.java | Throws/propagates a dedicated exception to report dotted embedded field paths when nulls are encountered during SQL mapping. |
| data-model/src/main/java/io/micronaut/data/exceptions/EmbeddableNullFieldException.java | Introduces a new DataAccessException subtype to represent “null embeddable field” failures with path context. |
033aa01 to
11f52d9
Compare
11f52d9 to
80eafe6
Compare
80eafe6 to
1916577
Compare
1916577 to
c106083
Compare
c106083 to
df5cf45
Compare
dstepanov
requested changes
Apr 13, 2026
df5cf45 to
cef3b52
Compare
cef3b52 to
6650ed8
Compare
6650ed8 to
08dce4c
Compare
…e Embedded object name
08dce4c to
ead064e
Compare
Author
|
@dstepanov Good to merge??? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes: #3254
Adding a custom exception whenever an embedded null field is detected and throwing the error that displays the exact field name which is null and not the embedded object name itself.