Storyboard JsonPersistency

How to serialize an object model to json and how to read json into an object model

Start: Example object structure:

Step 1: Serialize to json:

          *             "property":"students",
    *             "id":"karli : Student"
    *          }
    *       },
    *       {
    *          "type":"assoc",
    *          "source":{
    *             "cardinality":"many",
    *             "property":"rooms",

Results in:

[
   {
      "session":"demo",
      "class":"org.sdmlib.test.examples.studyrightWithAssignments.model.University",
      "id":"U527240378695639",
      "timestamp":"527240378695639",
      "prop":{
         "name":"StudyRight",
         "students":[
            {
               "session":"demo",
               "class":"org.sdmlib.test.examples.studyrightWithAssignments.model.Student",
               "id":"S527240378809973",
               "timestamp":"527240378809973"
            }
         ]
      }
   },
   {
      "session":"demo",
      "class":"org.sdmlib.test.examples.studyrightWithAssignments.model.Student",
      "id":"S527240378809973",
      "timestamp":"527240378809973",
      "prop":{
         "name":"Karli",
         "id":"4242",
         "university":{
            "class":"org.sdmlib.test.examples.studyrightWithAssignments.model.University",
            "id":"U527240378695639"
         }
      }
   }
]

Step 2: Now read it back again

          *          "source":{
    *             "cardinality":"many",
    *             "property":"rooms",
    *             "id":"artsRoom : Room"
    *          },
    *          "target":{
    *             "cardinality":"one",