title: How I can persist a json object using hibernate?
body: <p>This is my situation:
  I have a class with an attribute that can be a json type or another data structure. </p>
  
  <pre><code>public class MiClase {
  private int a;
  private Object b;
  //Get and Set method
  </code></pre>
  
  <p>}</p>
  
  <p>I want to persist this class using hibernate but also I want to use the following code:</p>
  
  <pre><code>ObjectMapper m=new ObjectMapper();
  m.readValue(json, new TypeReference&lt;MiClase&gt;() {
              });
  </code></pre>
  
  <p>the code above work fine but when I try to save the entity into database i get the following error:mapping has wrong number of columns: MiClase.b type: object
  then I try to change then i try to change de object type to byte[] but cannot deserialize instance of byte[] when using readValue method. What strategy do you recommend me in this situation?
  I´m using postgresql</p>