[JAVA-27545] Upgraded spring-jinq to spring-boot 3 (#15300)
This commit is contained in:
parent
5d6b5bf965
commit
a0b5fb3443
|
@ -10,9 +10,9 @@
|
|||
|
||||
<parent>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>parent-boot-2</artifactId>
|
||||
<artifactId>parent-boot-3</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<relativePath>../parent-boot-2</relativePath>
|
||||
<relativePath>../parent-boot-3</relativePath>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
@ -35,6 +35,11 @@
|
|||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-orm</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate.orm</groupId>
|
||||
<artifactId>hibernate-core</artifactId>
|
||||
<version>${hibernate-core.version}</version>
|
||||
</dependency>
|
||||
<!-- Testing -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
@ -58,7 +63,8 @@
|
|||
</build>
|
||||
|
||||
<properties>
|
||||
<jinq.version>1.8.29</jinq.version>
|
||||
<jinq.version>2.0.1</jinq.version>
|
||||
<hibernate-core.version>6.4.0.Final</hibernate-core.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -1,6 +1,6 @@
|
|||
package com.baeldung.spring.jinq.config;
|
||||
|
||||
import javax.persistence.EntityManagerFactory;
|
||||
import jakarta.persistence.EntityManagerFactory;
|
||||
|
||||
import org.jinq.jpa.JinqJPAStreamProvider;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
|
@ -1,19 +1,23 @@
|
|||
package com.baeldung.spring.jinq.entities;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.OneToOne;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.JoinColumn;
|
||||
import jakarta.persistence.ManyToOne;
|
||||
|
||||
|
||||
|
||||
@Entity(name = "CAR")
|
||||
public class Car {
|
||||
@Id
|
||||
private String model;
|
||||
private String description;
|
||||
private int year;
|
||||
private String engine;
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "name")
|
||||
private Manufacturer manufacturer;
|
||||
|
||||
@Id
|
||||
public String getModel() {
|
||||
return model;
|
||||
}
|
||||
|
@ -46,8 +50,6 @@ public class Car {
|
|||
this.engine = engine;
|
||||
}
|
||||
|
||||
@OneToOne
|
||||
@JoinColumn(name = "name")
|
||||
public Manufacturer getManufacturer() {
|
||||
return manufacturer;
|
||||
}
|
||||
|
|
|
@ -2,18 +2,19 @@ package com.baeldung.spring.jinq.entities;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.OneToMany;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.OneToMany;
|
||||
|
||||
@Entity(name = "MANUFACTURER")
|
||||
public class Manufacturer {
|
||||
|
||||
@Id
|
||||
private String name;
|
||||
private String city;
|
||||
@OneToMany(mappedBy = "model")
|
||||
private List<Car> cars;
|
||||
|
||||
@Id
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
@ -30,7 +31,6 @@ public class Manufacturer {
|
|||
this.city = city;
|
||||
}
|
||||
|
||||
@OneToMany(mappedBy = "model")
|
||||
public List<Car> getCars() {
|
||||
return cars;
|
||||
}
|
||||
|
@ -38,5 +38,4 @@ public class Manufacturer {
|
|||
public void setCars(List<Car> cars) {
|
||||
this.cars = cars;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.baeldung.spring.jinq.repositories;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.PersistenceContext;
|
||||
import jakarta.persistence.EntityManager;
|
||||
import jakarta.persistence.PersistenceContext;
|
||||
|
||||
import org.jinq.jpa.JPAJinqStream;
|
||||
import org.jinq.jpa.JinqJPAStreamProvider;
|
||||
|
|
|
@ -4,7 +4,6 @@ import com.baeldung.spring.jinq.JinqApplication;
|
|||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
import com.baeldung.spring.jinq.JinqApplication;
|
||||
|
||||
@SpringBootTest(classes = JinqApplication.class)
|
||||
public class SpringContextTest {
|
||||
|
|
Loading…
Reference in New Issue