-
Notifications
You must be signed in to change notification settings - Fork 35
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
Sometimes JPA Stream doesn't load properties with relationships #182
Comments
Could you provide more information? For example, under which conditions the Status is not loaded. If it is not loaded, is |
SQL: It was hard to debug because it's rare for the account's status object to return null, but sometimes it did return. I did not try joining the tables And the account status returned null for the same account, and when I went to check the database, the status was filled. |
Hi, I would love to take a closer look at this issue. However, it isn't easy to reproduce without your database and code example. Are you able to provide any more information? Generally, I recommend performing a join when in need of information from another table. In this case that would look like this:
|
I tried to reproduce the error here and was unsuccessful, but what I noticed was that even marking the property with fetch type lazy, the property was still loaded. |
Thanks for the update, as both of us failed to reproduce the issue I will close it for now. Regarding the fetching, that is a question for the underlying JPA provider. JPAStreamer does not interact with the database directly (only via the JPA provider) and thus cannot control how the data is fetched. |
My Account class:
My AccountStatus class:
My query with JPA
Sometimes the AccountStatus wasn't load and returning error. I fixed this bug changing JPAStream query to JPQL
The text was updated successfully, but these errors were encountered: