title: Mapping JSON Array to Spring Hibernate Database (H2)
body: <p>Hi I'm trying to map a JSON to databse table in SprinBoot. 
  This is my @Entity:</p>
  
  <pre><code>@Data
  @AllArgsConstructor
  @Entity
  public class User {
      @Id
      @GeneratedValue( strategy = GenerationType.AUTO )
      private Long id;
      private String name;
      private String tagline;
      private String first_brewed;
      @Column(length=700)
      private String description;
      private String image_url;
      private Long ibu;
      private String[] food_pairing;
  
      public User() {}
  }
  </code></pre>
  
  <p>And JSON looks that:</p>
  
  <pre><code>[
      {
          "id": 1,
          "name": "Buzz",
          "tagline": "A Real Bitter Experience.",
          "first_brewed": "09/2007",
          "description": "A light, crisp and bitter IPA brewed with English and American hops. A small batch brewed only once.",
          "image_url": "https://images.punkapi.com/v2/keg.png",
          "ibu": 60,
          "food_pairing": [
              "Spicy chicken tikka masala",
              "Grilled chicken quesadilla",
              "Caramel toffee cake"
          ]
      }
  ]
  </code></pre>
  
  <p>I want to save this in to the H2 database.</p>
  
  <p>Got only 1 column in the database with string of letters and numbers</p>
  
  <p>My question is: How to change </p>
  
  <blockquote>
    <p>private String[] food_pairing;</p>
  </blockquote>
  
  <p>to show all food_pairings as a separate columns in the database?</p>
  
  <p>(If I have an object in JSON i can do that in the @Entity:</p>
  
  <pre><code> @Embedded private Address address;
  </code></pre>
  
  <p>And then in other class: </p>
  
  <pre><code>@Embeddable public class Address {
  
   private String street;
   private String suite;
  
   }
  </code></pre>
  
  <p>And I have a automatic created columns in my database. I want to do the same but not with an object in JSON only with an Array of Strings in JSON.</p>