title: Parse string as json array from Postgre
body: <p>I have a table in PostgreSQL with 2 columns - Id and coord. 
  Column "coord" - geo coordinates stored as a string in JSON format.</p>
  
  <p>Example: </p>
  
  <pre><code>[{"lat":49.09693425316379,"lng":33.61747393628419},{"lat":49.11835977646441,"lng":33.638456496907},{"lat":49.12103137811804,"lng":33.63866144845382},{"lat":49.09694682809236,"lng":33.61746879914138},{"lat":49.08920750204137,"lng":33.61734796797724},{"lat":49.07643862058337,"lng":33.61246117651179}]
  </code></pre>
  
  <p>How to send such string as JSON Array of objects(POST request). </p>
  
  <p>Entity without getters and setters </p>
  
  <pre><code>public class Lepcoord implements Serializable {
  
  private static final long serialVersionUID = 1L;
  @Id
  @Basic(optional = false)
  @NotNull
  @Size(min = 1, max = 30)
  @Column(name = "tplnr")
  private String tplnr;
  @Size(max = 2147483647)
  @Column(name = "coord")
  private String coord;
  </code></pre>
  
  <p>Controller</p>
  
  <pre><code>@POST
  @RequestMapping(value= "/lep/{voltage}", method = RequestMethod.POST, headers = "Accept=application/json")
  @ResponseBody
  public ResponseEntity&lt;List&lt;Lepcoord&gt;&gt; lep (@PathVariable  String voltage) 
  {
      return new ResponseEntity&lt;&gt;(gisDaoService.lep(voltage), HttpStatus.OK);
  }
  </code></pre>
  
  <p>And service</p>
  
  <pre><code> @Transactional(readOnly = true)
      public List &lt;Lepcoord&gt; lep (String voltage) {
           Query  query = this.em.createQuery(    
               " From Lepcoord ");   
      List &lt;Lepcoord&gt; rez = null;
          try {
                  rez = (List&lt;Lepcoord&gt;) query.getResultList();
              } catch (PersistenceException r) {
                  return null;
              }
              return rez;
          }
  </code></pre>
  
  <p>Hibernate cant handle json type If i storeing coord as json in Postgre. May be someone knows easier way. Not to write own classes to work with Postgres json type</p>