0

I have a collection structure mapped on a Java class ( just like jongo does ). One of those objects is a generic class ( T ).

To insert data on the collection I used the annotation JsonProperty( "property_name" ) and it works pretty charm.

The problem is reading the results of this collection. Jongo returns a LinkedHashMap which, obviously cannot be casted to my custom class.

The question is: how to map the return to my custom class?

If I should make a custom mapper, how should I proceed?

Thanks! CYA

Guerino Rodella
  • 321
  • 4
  • 16
  • is it a find, findOne operation ? – Benoît Guérout May 19 '15 at 09:27
  • Maybe or maybe not. After depper research, I found a solution to this issue. Override the mapper on find query. But then I figured I could simple remap the LinkedHashMap calling a convert method from ObjectMapper. It works pretty good. But which one is the eager way to 're-map' Jongo Mapping? There are other ways to do? – Guerino Rodella May 19 '15 at 16:35

0 Answers0