[JAVA-27545] Upgraded spring-jinq to spring-boot 3 (#15300)
This commit is contained in:
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user