I'm using DataNucleus as a JPA implementation to store my classes in my web application. I use a set of converters which all have toDTO()
and fromDTO()
.
My issue is, that I want to avoid the whole DB being sent over the wire:
- If I lazy load, the converter will try to access ALL the fields, and load then (resulting in very eager loading).
- If I don't lazy load, I'll get a huge part of the DB, since user contains groups, and groups contains users, and so on.
Is there a way to explicitly load some fields and leave the others as NULL in my loaded class? I've tried the DataNucleus docs with no luck.