MorphiaOrg / MorphiaOrg/morphia

Mapping Abstract Classes?

Open
#2,492 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question Waiting for Response
Dominant language
Java
Stars
1.7k
Forks
449
Avg merge
7m
Merged PRs (30d)
10

Description

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.*?

Server Version: 5.0.14
Driver Version: 4.8
Morphia Version: 2.3.7

Thank You.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by searching Morphia 2.3.7 for the MappingException message and the mapping logic for @ExternalEntity abstract classes. Compare the behavior with Morphia 2.2.* using the reported Server Version 5.0.14 and Driver Version 4.8; done means isolating the regression or documenting the supported mapping behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, mongodb
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.