-
Notifications
You must be signed in to change notification settings - Fork 165
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
Checking for possible composite converters in GraphEntityMapper.writeProperty
#933
Checking for possible composite converters in GraphEntityMapper.writeProperty
#933
Conversation
if (writer == null || writer.isComposite()) { | ||
logger.debug("Unable to find property: {} on class: {} for writing", property.getKey(), classInfo.name()); | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would really like to have a separate conditional branch with a dedicated message, maybe even more visible level, here.
if (writer == null || writer.isComposite()) { | |
logger.debug("Unable to find property: {} on class: {} for writing", property.getKey(), classInfo.name()); | |
} else { | |
if (writer == null) { | |
logger.debug("Unable to find property: {} on class: {} for writing", property.getKey(), classInfo.name()); | |
} else if (writer.isComposite()) { | |
logger.info("Property is already handled by a CompositeAttributeConverter"); // or similar wording |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that makes sense. Just FYI, for other properties that are handled by the CompositeAttributeConverter, which do not have the name conflict, the method gets also called and the writer
is actually null
. Therefore, the original debug message might also be misleading, but we can probably not differentiate between "somehow we could not find the property" and "property is already handled" in the first if.
Thanks for the PR, could you also provide a test case for this? Line 313 in 0079fd7
(Please don't be irritated by the ..Rule naming ;) )
|
Sure, will do. Might need a little bit to find the proper test layout. |
Unfortunately, I am a little lost with regards to tests @meistermeier. I can find tests for the |
TBH the test suite is broad but unfortunately not well sorted. Something we have to address in the future (tried this once and dismissed it ;) ) Line 54 in 0079fd7
I will revisit it (or leave it there) before merge. Thanks for the effort. |
Just saw your test commit: Just leave it as it is. Would also work for me. |
85a1ed1
to
9d59ed2
Compare
Ok I did that. The tests run successful on my machine. Fingers crossed for GitHub actions ;) |
Locally this is already running perfectly fine. I would go ahead and merge this. |
Done |
…eProperty` This allows to resolve conflicts when a property is using a composite converter. Fixes neo4j#932
9d59ed2
to
5166b5c
Compare
Thanks for signing and letting me push the changes on your branch. |
Excellent, thanks! Just wondering... Are you following a certain release schedule, e.g. every X months or are you basically releasing if enough PRs are merged? Looking forward to 4.0.2 ;) |
...like this https://github.com/neo4j/neo4j-ogm/releases/tag/v4.0.2? |
This allows to resolve conflicts when a property is using a composite converter.
Fixes #932