Open iAmcR opened 1 year ago
@Entity should work just fine
Is @Entity
transitive to subclasses or do I need to annotate the subclasses with @Entity
as well?
I ask because, before you replied I tried @Entity
and got a stack overflow error.
Well, a SO is a bug regardless. If you could put together a reproducer I'd be happy to take a look and see.
But @Entity is inherited so you should only need it on the base type unless you want to put certain subtypes in a different collection, e.g.
I'll put a reproducer together. My framework is different, so hopefully, it'll illustrate the issue.
Any progress?
Hi. I should have replied sooner. Thank you for the reminder.
We had to revert to 2.2, as we had to get our service into production. We are planning to upgrade this month and would have responded here with our findings.
We need to upgrade from 2.2, because at seeming random times for composite queries that contain box()
or nearSphere()
, an exception of the form: dev.morphia.query.ValidationException: Could not resolve path 'm' against 'Model'. Unknown path element: 'mmmmm'.
is being thrown.
These queries do work so it shouldn't be a validation issue. Any ideas why that is happening or what I can do to prevent the exception?
Without seeing the code or a reproducer I could only guess. But if you know the queries are valid, you can [disable validation](https://morphia.dev/morphia/2.4/javadoc/dev/morphia/query/Query.html#disableValidation()) for those until we can figure out the root cause.
I'm moving from 2.2 to 2.3 (to eventually move to 2.4) and I'm having issues mapping abstract classes.
Since these classes aren't persisted, I annotated them as
@ExternalEntity
However, a MappingException is being thrown with messages of the form: Mapped field 'x' on 'Y' doesn't match any fields on 'Z'.
Could you please give any hints or reasons why this is happening, considering that all worked fine in version 2.2.*?
Thank You.