Skip to content
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

Nested objects doesn't work with inner joins and register bean mapper #2667

Open
jarlah opened this issue Apr 8, 2024 · 1 comment
Open

Comments

@jarlah
Copy link
Contributor

jarlah commented Apr 8, 2024

I have struggled with making inner joins and registering bean mappers to load nested objects in another project and i decided to make a proof of concept project (https://github.com/jarlah/jdbi3-nested-innerjoin-example/tree/main) for what I am struggling with. It's very very basic, and I hope it's something really stupid I have done wrong on my side and not a bug.

see failing test and code here https://github.com/jarlah/jdbi3-nested-innerjoin-example/blob/main/src/test/java/com/example/jdbi3/NestedObjectTest.java#L24

(the github workflow fails for something completely different. the test fails properly locally)

If there is an existing issue for this problem just close this issue

@jarlah
Copy link
Contributor Author

jarlah commented Apr 8, 2024

[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 10.27 s <<< FAILURE! -- in com.example.jdbi3.NestedObjectTest
[ERROR] com.example.jdbi3.NestedObjectTest.test -- Time elapsed: 0.198 s <<< ERROR!
java.lang.NullPointerException: Cannot read field "id" because "java.util.List.get(int).nestedStuff" is null
	at com.example.jdbi3.NestedObjectTest.test(NestedObjectTest.java:46)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant