title: Saving arrays of elements in the json object into different rows
body: <p>While saving json object containing multiple jsons, the json object is being saved as a single array instead of multiple rows.</p>
  
  <p>sample json:</p>
  
  <pre><code>[
      {
       "id"   : 1, -- this is not a primary key and not unique but cannot be null
       "name" : "John Doe",
       "phone" : [
         { "type" : "home", "ref" : "111-111-1234"},
         { "type" : "work", "ref" : "222-222-2222"}
       ]
     },
     {
      "id"   : 2, -- this is not a primary key and not unique but cannot be null
      "name" : "Jane Doe",
      "phone" : [
        { "type" : "home", "ref" : "111-111-1234"},
        { "type" : "work", "ref" : "222-222-2222"}
      ]
    }
  ]
  </code></pre>
  
  <p>This is what i need after saving in the database</p>
  
  <pre><code>id   name         phone    
  1    John Doe     { "type" : "home", "ref" : "111-111-1234"}
  1    John Doe     { "type" : "work", "ref" : "222-222-2222"}
  2    Jane Doe     { "type" : "home", "ref" : "111-111-1234"}
  2    Jane Doe     { "type" : "work", "ref" : "222-222-2222"}
  </code></pre>
  
  <p>This is what I am getting</p>
  
  <pre><code>id   name         phone    
  1    John Doe     [{ "type" : "home", "ref" : "111-111-1234"},{ "type" : "work", "ref" : "222-222-2222"}]
  2    Jane Doe    [{ "type" : "home", "ref" : "111-111-1234"},{ "type" : "work", "ref" : "222-222-2222"}]
  </code></pre>
  
  <p>here is how i am parsing the json object to pojo and saving to db</p>
  
  <pre><code>@Entity
  @Table(name="person")
  public class person{
      private Integer id;
      private String name;
      private String phone;
      @Transient 
      JsonNode phoneJson;
  
      private static OhjectMapper mapper = new ObjectMapper();
  
      getter/setter
  
      @Transient
      public JsonNode getPhoneJson(){
          return phoneJson;
      }
  
      public void setPhoneJson(JsonNode phoneJson){
          this.phoneJson = phoneJson;
      }
  
      @JsonIgnore
      @Column(name="phone")
      public String getPhone() throws Exception{
          return mapper.writeValueAsString(phoneJson);
      }
  
      public void setPhone(String phone) throws Exception{
          this.phone = mapper.readTree(phone);
      }
  }
  </code></pre>
  
  <p>dao- save</p>
  
  <pre><code>personRepository.save(person)
  </code></pre>
  
  <p>any help would be appreciated.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Multiple jSON Column</p>
  
  <pre><code>[
      {
       "id"   : 1, -- this primary key and not unique but cannot be null
       "name" : { --this element can be empty/null
          "first" : "John",
          "last" : "Doe" 
        },
       "phone" : [
         { "type" : "home", "ref" : 1111111234},
         { "type" : "work", "ref" : 2222222222}
       ]
     },
     {
      "id"   : 2, -- this primary key and not unique but cannot be null
      "name" : {
          "first" : "Jane",
          "last" : "Doe" 
        },
      "phone" : [
        { "type" : "home", "ref" : 1111111234},
        { "type" : "work", "ref" : 2222222222}
      ]
    }
  ]
  </code></pre>
  
  <p>how do i get result as below</p>
  
  <pre><code>id   name                   phone    
  1    [{John},{Doe}]     { "type" : "home", "ref" : "111-111-1234"}
  1    [{John},{Doe}]     { "type" : "work", "ref" : "222-222-2222"}
  2    [{Jane},{Doe}]     { "type" : "home", "ref" : "111-111-1234"}
  2    [{Jane},{Doe}]     { "type" : "work", "ref" : "222-222-2222"}
  </code></pre>