Skip to content
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

Support embedded lists of a generic type parameter #552

Closed
dklotz opened this issue Nov 14, 2013 · 2 comments
Closed

Support embedded lists of a generic type parameter #552

dklotz opened this issue Nov 14, 2013 · 2 comments
Assignees
Labels
Milestone

Comments

@dklotz
Copy link

dklotz commented Nov 14, 2013

I tried to set up a class hierarchy like this:

public abstract class Status<T extends Item> {
  @Embedded(concreteClass = java.util.ArrayList.class)
  private List<T> items;

  // ...
}

public class EmailStatus extends Status<EmailItem> {
  // ...
}

But when trying to map this, I get a RuntimeException: "bad type, not parameterized...". I thought this was related to issue #80, which is fixed sind 0.99.1, and we are using 0.105, but it still doesn't work. Am I doing something wrong or is this just not supported?

Cheers,
David

What version are you using? (Morphia/Driver/MongoDB)
Morphia 0.105, Driver 2.11.3, DB v2.4.7

Please include a stack trace below:
java.lang.RuntimeException: bad type, not parameterized...
at org.mongodb.morphia.utils.ReflectionUtils.isPropertyType(ReflectionUtils.java:177)
at org.mongodb.morphia.mapping.MappedField.discover(MappedField.java:104)
at org.mongodb.morphia.mapping.MappedField.(MappedField.java:76)
at org.mongodb.morphia.mapping.MappedClass.discover(MappedClass.java:194)
at org.mongodb.morphia.mapping.MappedClass.(MappedClass.java:119)
at org.mongodb.morphia.mapping.Mapper.addMappedClass(Mapper.java:152)
at org.mongodb.morphia.Morphia.map(Morphia.java:64)
at com.fileee.SomeTest.createMorphia(SynchronizationStatusTest.java:43)

@evanchooly evanchooly added the bug label Feb 25, 2014
@evanchooly evanchooly added this to the 0.107 milestone Feb 25, 2014
@evanchooly evanchooly self-assigned this Feb 25, 2014
@evanchooly evanchooly modified the milestones: 0.107, post-1.0 Feb 27, 2014
@jbasrai
Copy link

jbasrai commented Feb 2, 2015

Is there any known solution/workaround for this?

@evanchooly evanchooly removed this from the post-1.0 milestone Jan 14, 2016
@evanchooly evanchooly added this to the 2.0 milestone May 25, 2016
@evanchooly
Copy link
Member

works in 2.0

evanchooly added a commit that referenced this issue Nov 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants