lightcouch / LightCouch

CouchDB Java API
www.lightcouch.org
Apache License 2.0
67 stars 70 forks source link

Unable to parse generic members #61

Open ramkimpls opened 7 years ago

ramkimpls commented 7 years ago

It is now impossible to fetch a document (json) whose class has generic members. The exposed find() method would only take a "Class" parameter. For any java class that has a generic type as a member ,the deserialization fails. for example -

class MyClass< T > { private string _id; private T details; }

class Details{ private String name; private String city; }

Assuming a doc confirming to the above structure is saved in couchdb, there seems to be no way to fetch the doc. The overloaded find() method would only take a 'Class' type as an argument and the generic class (in this case Details ) would never get populated