title: How to read jsonb from Postgres using the Jsonb library
body: <p>I am trying to read a jsonb field from a postgre table. I have tried to read it as a Jsonb type using the Jsonb library in the following way:</p>
  
  <pre><code>@Entity
  @Table(name = "test")
  data class Test(
      @Id
      val id: UUID = UUID.randomUUID(),
  
      @Type(type = "jsonb")
      @Column(columnDefinition = "jsonb")
      val candidates: Jsonb = JsonbBuilder.create(),
  
  )
  </code></pre>
  
  <p>But apparently, it doesnt build giving me the following error:</p>
  
  <pre><code>Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.boot.registry.classloading.spi.ClassLoadingException: Unable to load class [jsonb]
  </code></pre>
  
  <p>I have found a few posts and answer. But none of them are apparently using <a href="https://mvnrepository.com/artifact/javax.json.bind/javax.json.bind-api/1.0" rel="nofollow noreferrer">this</a> api </p>