Skip to content

Map multiple subtypes to the same class #364

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

Closed
umbreak opened this issue Dec 10, 2013 · 2 comments
Closed

Map multiple subtypes to the same class #364

umbreak opened this issue Dec 10, 2013 · 2 comments

Comments

@umbreak
Copy link

umbreak commented Dec 10, 2013

From the issue described here: http://stackoverflow.com/questions/18394819/jackson-polymorphism-how-to-map-multiple-subtypes-to-the-same-class

I've got an abstract class with an enum and I want to use this enum to unmarshalled the class to the correct subclass. That should be possible, and I don't know why it exist this restriction "one-to-one (bijection) relationship"

Thanks,
Didac

@cowtowncoder
Copy link
Member

This sounds like a dup of #312?

The limitation is due to implementation; although there is also bit of concern that allowing non-bijective mapping means that round-tripping will not work as expected. That is, for some cases having duplicate classes or ids is an actual error condition.

@cowtowncoder
Copy link
Member

Closing as dup of #312, which hopefully will be fixed in near future (most likely for 2.6, but slight chance might get in 2.5).

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

2 participants