-
Notifications
You must be signed in to change notification settings - Fork 617
Fix NullPointerException
when using known entities inside projections.
#2349
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
Comments
I see no such field in the class you shared. Can you please share a small reproducer, including a dataset? Thanks. |
There is no field in the person entity. This is wished for us for performance purpose. I showed something really simplified compared to our use case, but we can't put the field in the entity. The code I shared will produce the NPE. |
The code you shared is incomplete and has errors, however I try to investigate nevertheless. |
NullPointerException
when using known entities inside projections.
Reproduced and fixed. Will be available in the next 6.1 patch release. Thank you very much for your report. |
… projections. When a known entity is discovered in the PropertyFilterSupport, it can be used directly as the property type than is equal to a domain type (a well known entity). Prior to that change, the discovered well known entity was used and it was asked for the the type of the property of the containing class again, which is wrong in most cases that don't have a property of the fitting type _and_ the same name again. In addition, one other bug has been fixed: The `Neo4jTemplate` did not pass result type and domain type in the `saveAs` method to the `PropertyFilterSupport`, but only the result type, leading to the original fix to blow up. Having fixed that bug, it became appearent that in the `PropertyFilterSupport` the overloads of `addPropertiesFrom` different order of `domainType` and `returnType`which then has been fixed as well. This closes #2349.
I'm experiencing some issues with the latest version
6.1.3
with the mapping that has changed. The following does not work anymore:which produces the following stacktrace :
It tries to fetch the
department
field in theperson
entity, andPropertyFilterSupport
doesn't handle the nullpersistentProperty
.I'm pretty sure this bug was introduced with the
multi-level
projection support: #2314This exact query works in 6.1.2, so my expectations for the behaviour would be that this keeps working with 6.1.3.
Thank you!
The text was updated successfully, but these errors were encountered: