Package io.ebean.text.json

JSON formatting and parsing objects (See JsonContext).

The goal is to provide JSON support taking into account various ORM issues such as partial objects (for fetching and updating), reference beans and bi-directional relationships.


  // find some customers ...

 List<Customer> list = DB.find(Customer.class)
     .select("id, name, status, shippingAddress")
     .fetch("billingAddress","line1, city")
     .fetch("", "*")
     .fetch("contacts", "firstName,email")

 JsonContext json = DB.json();

  // output as a JSON string
 String jsonOutput = json.toJson(list);