Criteria Builder for jsonb type as array json

Viewed 33

I have Json Array stored in a postgreSQL database. I want to search over this array but written code doesn't work for a List of Network :

predicates.add(builder.equal(builder.function("jsonb_extract_path_text",
                                        String.class, dtoRoot.get("networks"),
                                        builder.literal("technology")), "searched_text"));


public class Network {
  private String technology;
  private String network;
}

 in entity :
  @Type(type = "jsonb")
  @Column(name = "networks",columnDefinition = "jsonb")
  List<Network> networks;
0 Answers
Related