-
Notifications
You must be signed in to change notification settings - Fork 456
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
Lazy loading in interfaces #1217
Comments
This is forever late, i know. I'm trying to get caught back up and prevent such delays in the future. Is this still an issue for you? Can you provide the error you were getting? I have a feeling I know the general themes of it but it would help me isolate the actual cause. Thanks. |
Hey! Thanks for looking into this. The truth is that I sort of abandoned the idea of using Morphia, as I couldn't find a workaround for this, and I really didn't want to give up of my data model (i.e turning interfaces into classes). I do not have a stack trace, and probably won't be able to provide you with one since my projects have then evolved, but I think the issue is quite reproducible. Anyway, it would be really cool to have this fixed, and I'm glad to help as much as I can. 😄 |
OK. Thanks for the update and sorry for the interminable delay. I'd stepped away for a while but I'm back now and trying to pick up the threads. |
Good news then! 😄 Morphia is a great framework |
fixed |
I still need to confirm maps/collections of lazy references... |
Hello, i've been using morphia on a java project, with a complex hierarchy (i.e. multiple interfaces, abstract classes, etc.). I've reach to a point where, in order to reduce the overhead of reading the entire structure of an entity, i decided to use the lazy loading features of Morphia. The problem arises when Morphia tries to lazy load a field that is stored as one of the interfaces used, for instance:
Considering that both
InterfaceA
andInterfaceB
are entities stored in MongoDB, when i fetch anInterfaceA
object from the database,b
is wrapped in a proxy. However, upon invocation of any of the proxy's methods, Morphia will attempt to fetch the respective object with field validation turned on, as described in the source code. This creates an obvious problem, as validating fields over interface types makes no sense.Is there any workaround or should this be considered a bug/enhancement?
As expressed in the CONTRIBUTING file:
The text was updated successfully, but these errors were encountered: