json - Map mongodb collection to non existing java class -
i've got mongodb several collections , need map collects new java classes using spring. first idea expect 1 item json , generate java class based on json code. here's json:
{ "_id" : objectid("5550b632e6d665c6fc8b4567"), "id" : numberint(1), "registrationdate" : "2008-11-02 10:55:05", "firstname" : "", "lastname" : "", "email" : "mail@mail.nl", "salutation" : "", "enabled" : false, "bouncecount" : numberint(0), "groups" : [ numberint(1), numberint(15), numberint(16), numberint(19), numberint(20), numberint(21), numberint(22) ], "tags" : [ numberint(1), numberint(19), numberint(29), numberint(34), numberint(49), numberint(51), numberint(68), numberint(89), numberint(547), numberint(568), numberint(569), numberint(571) ], "identifier" : "s47foeqyzut7xenfkpikzwkc5ltryrcl", "orders" : [ { "langindependentid" : numberint(39), "orderdate" : numberint(1279584917), "updateperiod" : numberint(1342821599), "amounteur" : numberint(1989) }, { "langindependentid" : numberint(41), "orderdate" : numberint(1279623009), "updateperiod" : numberint(1405893599), "amounteur" : numberint(990) } ], "lang" : "", "langs" : null, "hitlist" : numberint(0), "country" : "", "insertdate" : isodate("2006-11-02t10:55:05.000+0000"), "updatedate" : isodate("2007-02-03t10:37:05.189+0000"), "insert_date" : numberint(1431352882), "update_date" : numberint(1435141711) }
first of all, no tool able generate according java classes, items "numberint" or "isodate" not known... removed terms , adjusted javacode, not possible query mongodb , parse result java classes using springframework....
if create new class , insert new class collection, fine... idea this?
try @transient annotation "hide" attributes, if not needed. see http://static.springsource.org/spring-data/data-document/docs/current/reference/html/#mapping-usage-annotations
Comments
Post a Comment