Skip to content

Tag: jpa

How to use Postgres JSONB datatype with JPA?

Im not finding a way to map the JSON and JSONB datatypes from PostgreSQL using JPA (EclipseLink). Is some one using this datatypes with JPA and can give me some working examples? Answer All the answers helped me to reach the final solution that is ready for JPA and not EclipseLink or Hibernate specifically.

JPA update based on column name

I want to update value to a specific column entered by the user. Here are my codes, do anyone how to modify it to correct one? Answer You should go for criteria builder query for your case… if you are using JPA 2.1.. here is something you can should do

JPA Criteria multiselect with fetch

I have following model: Now I would like to query only columns: id, name, shortName and mentor which referes to User entity (not complete entity, because it has many other properties and I would like to have best performance). When I write query: I have following exception: Query before exception: I know that…