Top "Jpa" questions

The Java Persistence API (JPA) is a Java specification for accessing, persisting, and managing data between Java objects/classes and a relational database.

How to store date/time and timestamps in UTC time zone with JPA and Hibernate

How can I configure JPA/Hibernate to store a date/time in the database as UTC (GMT) time zone? Consider …

java hibernate datetime jpa timezone
JPQL IN clause: Java-Arrays (or Lists, Sets...)?

I would like to load all objects that have a textual tag set to any of a small but arbitrary …

sql orm jpa jpql named-query
JPA 2.0, Criteria API, Subqueries, In Expressions

I have tried to write a query statement with a subquery and an IN expression for many times. But I …

jpa subquery jpa-2.0 criteria-api in-subquery
How does JPA orphanRemoval=true differ from the ON DELETE CASCADE DML clause

I am a little confused about the JPA 2.0 orphanRemoval attribute. I think I can see it is needed when I …

hibernate jpa cascade cascading-deletes orphan-removal
Do I need <class> elements in persistence.xml?

I have very simple persistance.xml file: <?xml version="1.0" encoding="UTF-8"?> <persistence version="1.0" xmlns="http://java.sun.…

java hibernate orm jpa annotations
How to beautifully update a JPA entity in Spring Data?

So I have looked at various tutorials about JPA with Spring Data and this has been done different on many …

java spring jpa spring-data spring-data-jpa
JPA OneToMany not deleting child

I have a problem with a simple @OneToMany mapping between a parent and a child entity. All works well, only …

java jpa jpa-1.0
PersistenceContext EntityManager injection NullPointerException

I have a war containing the following: META-INF/MANIFEST.MF WEB-INF/classes/META-INF/persistence.xml WEB-INF/classes/com/test/service/…

java hibernate jpa jboss resteasy
IN-clause in HQL or Java Persistence Query Language

I have the following parametrised JPA, or Hibernate, query: SELECT entity FROM Entity entity WHERE name IN (?) I want to …

java hibernate jpa hql jpql