Questions tagged [jpa-2.2]

This tag is for questions specifically about new features of version 2.2 of the Java Persistence API.

63 questions
0
votes
1 answer

@Embeddable is Foo.class' PK and Bar.class' FK to Foo.class

I am trying to define JPA layer over a db I cannot redesign. That layer contains a OneToMany relationship where the Many part has a foreign key consisting of the same 2 fields that the one part has as primary key. @Embeddable public class FooKey…
Whimusical
  • 5,757
  • 8
  • 51
  • 91
0
votes
0 answers

Eclipse projects facets jpa version 2.2 needed

i could not find an answer to my question. I would like to use JPA V2.2 facet. but with the built in Jpa projects facet in eclipse JEE the version is maxed out on V2.1. Is there any way to update the facet to be 2.2 and not 2.1?
0
votes
0 answers

jpa 2, use type sage query and avoid querying nested entities

I'm using JPA 2.2 with Hibernate 5.2 implementation. I have the following entity: public class Order implements Serializable { private String customer; @OneToOne(fetch = FetchType.LAZY) @JoinColumn((name = "ID", referencedColumnName =…
Fabrizio Stellato
  • 1,379
  • 13
  • 33
0
votes
0 answers

Spring Data Jpa rollback of Primary Key is not working

I am working in Spring Boot (2.1.7.RELEASE) + Spring Data JPA + postgres example and looking to rollback Primary Key Id in case of any exception occurs. I went through…
Pra_A
  • 7,134
  • 12
  • 89
  • 170
0
votes
1 answer

Spring Data Jpa - Repository Query to get MaxID + 1?

I went through Spring CRUD repository: is there findOneByMaxXYZColumn()? and Spring data jpa. Find max if no result return default value already, but I am looking more from the correct implementation perspective in concurrent environment. In my…
Jeff Cook
  • 5,050
  • 13
  • 65
  • 127
0
votes
3 answers

Spring Data Jpa not automatically taking Next Id (PK), it always starts from 1

I am developing Spring Boot (2.1.7.RELEASE) +Data Jpa + Postgres example. In this example I am explicitly passing EMP_ID value=100 and next I am allowing data-jpa to automatically take next Id which is 101. I am not sure why its not working in that…
Jeff Cook
  • 5,050
  • 13
  • 65
  • 127
0
votes
2 answers

com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class org.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor

I already went through: Could not write JSON: Infinite recursion (StackOverflowError); nested exception spring boot & many links like this. I am using Spring Boot 2.1.6.RELEASE and Data JPA and Postgres example This is my source code:…
Pra_A
  • 7,134
  • 12
  • 89
  • 170
0
votes
1 answer

not write JSON: Infinite recursion (StackOverflowError); nested exception is com.fasterxml.jackson.databind.JsonMappingException: Infinite recursion

I am developing Spring Boot + Data Jpa + Postgres + Swaggerfox example. In this example I am getting below error. Error: 2019-08-06 20:29:02.449 WARN 24884 --- [nio-8080-exec-1] o.h.e.loading.internal.LoadContexts : HHH000100: Fail-safe…
Pra_A
  • 7,134
  • 12
  • 89
  • 170
0
votes
1 answer

Spring Data JPA - create @Composite key for the three tables

I am extending my question from here: Define CompositeKey with three tables using JPA/Hibernate?. In this example, I am looking to create Composite key to create unique combination of PRODUCT_ID, CATEGORY_ID, STOCK_ID. I developed below code, but…
Pra_A
  • 7,134
  • 12
  • 89
  • 170
0
votes
1 answer

Multi column search using Specifications Spring Data Jpa within associated entity?

I am taking this question Perform multi column search on Date, Integer and String Data type fields of Single Table? and This method must return a result of type Specification in Java 8 further ahead. Actually I wanted to search within…
Pra_A
  • 7,134
  • 12
  • 89
  • 170
0
votes
2 answers

Perform multi column search on Date, Integer and String Data type fields of Single Table?

I am working Spring Data - Multi-column searches and Spring Data Jpa - The type Specifications is deprecated where I wants to search for multiple columns like Date (Java 8 LocalDateTime, Instant, LocalDate etc.,), Integer and String data…
Pra_A
  • 7,134
  • 12
  • 89
  • 170
0
votes
2 answers

How to sort By Name and status Active for JPA repository query?

I am developing Spring Boot + Spring Data JPA + Postgres + Lombok example. In this example, I want to fetch all student firstName is ASC order and whose status in Active. I developed below query, which works fine, but I dont see a way to also use…
Pra_A
  • 7,134
  • 12
  • 89
  • 170
0
votes
1 answer

JPA Model Class for field TIMESTAMP WITHOUT TIME ZONE DEFAULT CURRENT_TIMESTAMP in Postgres?

I've below Table in Postgres and using Java 8 and Postgres-11 with Spring Boot 2.1.6.RELEASE. I already went through this question and this question, but I really wanted to use Java 8 Date API and not Java 7. CREATE TABLE note( note_id serial…
Pra_A
  • 7,134
  • 12
  • 89
  • 170
0
votes
1 answer

Problem with persistence provider in a jpa and struts project

I'm developing a java ee aplication using jpa to control a mysql db and struts. Unfortunately when I run the project on a tomcat server I get this error. javax.persistence.PersistenceException: No Persistence provider for EntityManager named prova …
0
votes
0 answers

Eclipse Photon with JPA: import javax.persistence can not be resolved

I installed GlassFish 5 and GlassFish Tools (from http://download.eclipse.org/glassfish-tools/1.0.0/repository/). I also tried with GlassFish 4.1.1, results were the same. I created a new JPA Project (JPA 2.1): In Data Source Explorer View of…
Markus
  • 522
  • 5
  • 21