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

How to skip not loaded Lazy fields? #723

Open
kfgisbis opened this issue Aug 25, 2023 · 0 comments
Open

How to skip not loaded Lazy fields? #723

kfgisbis opened this issue Aug 25, 2023 · 0 comments

Comments

@kfgisbis
Copy link

I have an entity that hibernate loads depending on a graph.
Sometimes I need one field, sometimes another.
An entity has some nesting, even a collection within a collection.
I need not to transfer fields to dto that are not initialized.

I see three solutions, but I don't know how to implement them:

  1. Determine that this is not a loaded object and skip it.
  2. Send to the mapper a list of field names to be skipped.
  3. Catch an error and assign null.

At the first level, it is clear how to skip fields, but at the second or third level, and even in an object that is in the collection...

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

No branches or pull requests

1 participant