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