This tag is for questions specifically about new features of version 2.2 of the Java Persistence API.
Questions tagged [jpa-2.2]
69 questions
47
votes
10 answers
EclipseLink 2.7.0 and JPA API 2.2.0 - signature mismatch
When running a project built by maven with the following dependencies:
org.eclipse.persistence
javax.persistence
2.2.0
…

Stéphane Appercel
- 1,427
- 2
- 13
- 21
27
votes
2 answers
JPA Storing OffsetDateTime with ZoneOffset
I have the following entity class:
@Entity
public class Event {
private OffsetDateTime startDateTime;
// ...
}
However, persisting and then reading the entity to/from the database with JPA 2.2 results in a loss of information: the…

Christopher Chianelli
- 1,163
- 1
- 8
- 8
12
votes
2 answers
HHH000342: Could not obtain connection to query metadata : null
Im trying to insert some simple data in my local mysql database using jpa-2.2 with hibernate in my java project
this is the pom related:
javax.persistence
…

Andres Cárdenas
- 720
- 1
- 5
- 26
9
votes
2 answers
Upgrading from JPA 2.1 to JPA 2.2
I'm having issues upgrading to JPA 2.2. I'm using eclipselink and changed the version in my pom:
org.eclipse.persistence
eclipselink
…

Leon Dendle
- 121
- 1
- 5
8
votes
2 answers
From which version on will Hibernate support JPA 2.2?
As Java EE 8 including JPA 2.2 was released this summer it's good to know when Hibernate will support it.
Hibernate 5.2 is mentioned to support JPA 2.1. Hibernate 6.0 roadmap doesn't have any references to JPA 2.2 support.
Thanks.

Sergiy
- 1,854
- 4
- 22
- 34
6
votes
6 answers
How to stream large Blob from database to application using JPA?
I have JPA a entity class that contains a blob field like this:
@Entity
public class Report {
private Long id;
private byte[] content;
@Id
@Column(name = "report_id")
@SequenceGenerator(name = "REPORT_ID_GENERATOR", sequenceName…

M-Soley
- 265
- 1
- 4
- 13
5
votes
1 answer
Are positional parameters deprecated in Hibernate 5.3.2?
We are migratiing from Hibernate 3 to Hibernate 5.3 ,We have used positional parameters in HQL, I see some posts on Hibernate support saying that positional parameters are no longer supported in Hibernate 5. And should be replaced with named…

Harsha vardhan yadlapalli
- 51
- 1
- 4
3
votes
1 answer
Spring Data Jpa - The type Specifications is deprecated
I am implementation the logic from link: Spring Data - Multi-column searches where I am looking to search by FirstName.
As per link:…

PAA
- 1
- 46
- 174
- 282
3
votes
2 answers
Hibernate 5 - java.lang.NoSuchMethodError: javax.persistence.Table.indexes()
I'm trying to test some POJOs with hibernate annotations and I'm getting the same error on and on. I used the same configuration in another project and it all worked fine. I tested the jdbc connection that is used when the hib objects are tested -…

JeanPierre
- 31
- 1
- 3
3
votes
1 answer
Hibernate CompositeUserType that is comparible in JPA-QL (or HQL) query
I've created a custom type for Hibernate to store an OffsetDateTime's timestamp and offset (because the default JPA 2.2 / Hibernate 5.2 with java 8 support implementation loses the offset information):
public class OffsetDateTimeHibernateType…

Geoffrey De Smet
- 26,223
- 11
- 73
- 120
2
votes
1 answer
JPA persistence unit definitions are conflicting
I want to use one class and two JPA persistence units and as such to be able to store data in different tables (or even databases) and different definitions.
According to the JPA2.2 specification this should be possible but I experience weird…

thehpi
- 5,683
- 4
- 17
- 24
2
votes
1 answer
The statement was aborted because it would have caused a duplicate key value
Part of my Java EE application is user management. My development environment is Netbeans 12.0 on Windows 10, JDK 14, Glassfish server 5.1, Apache Derby DB, and the eclipse persistence JPA. Currently, in the development phase, I have configured the…

Darvin
- 148
- 8
2
votes
1 answer
Netbeans 12.0 - Generating Entity Classes from DB uses Java Date class instead of LocalDate
I am using Netbeans 12.0, and to create my Entity classes for my DB tables, I use Netbeans Entity Classes from Database. It works great other than the fact it defaults all my date columns to the pre Java 8 Date classes, and I recently discovered…

cela
- 2,352
- 3
- 21
- 43
2
votes
2 answers
java.lang.ClassCastException: [B cannot be cast to [Ljava.lang.Object; while using JPA 2.2 query.getResultStream().findFirst()
The code of my Spring Data repository method is as follows:
public Optional findShipmentLabelByClientIdAndAwb(String clientId, String awb) {
String queryString = "select g.shipmentLabel as shipmentLabel from GenericShipment g where…

Dragoş Haiduc
- 33
- 1
- 5
2
votes
0 answers
What is the difference between "Persistent Class" and "Entity" in JPA or in Hibernate?
First things first:
I'm aware of this question, which, at the high level of abstraction, asks same what I ask here; however, I find it (and its answer) lacking, therefore, I would like to elaborate on this topic here;
I would kindly ask anyone, who…

Giorgi Tsiklauri
- 9,715
- 8
- 45
- 66