JAVA-29067: [FIX] spring-boot-persistence-3 migration to jdk17 (#15433)
* JAVA-29067: [FIX] spring-boot-persistence-3 migration to jdk17 * JAVA-29067: [FIX] Migrate from javax to jakarta. * [FIX]: logback error.
This commit is contained in:
parent
c143ccdf78
commit
6bc1391e1f
|
@ -60,7 +60,7 @@
|
|||
<!-- <module>sirix</module> --> <!-- We haven't upgraded to java 11. Fixing in BAEL-10841 -->
|
||||
<module>solr</module>
|
||||
<module>spring-boot-persistence-2</module>
|
||||
<!--<module>spring-boot-persistence-3</module>--> <!-- failing after upgrading to jdk17 -->
|
||||
<module>spring-boot-persistence-3</module>
|
||||
<!--<module>spring-boot-mysql</module>--> <!-- failing after upgrading to jdk17 -->
|
||||
<module>spring-boot-persistence</module>
|
||||
<module>spring-boot-persistence-h2</module>
|
||||
|
|
|
@ -59,8 +59,11 @@
|
|||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
<properties>
|
||||
<spring.boot.dependencies>2.1.8.RELEASE</spring.boot.dependencies>
|
||||
<spring.boot.dependencies>3.2.0</spring.boot.dependencies>
|
||||
<org.slf4j.version>2.0.9</org.slf4j.version>
|
||||
<logback.version>1.4.14</logback.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -1,11 +1,16 @@
|
|||
package com.baeldung.countrows.entity;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
import java.security.PrivateKey;
|
||||
import java.sql.Timestamp;
|
||||
import java.time.Instant;
|
||||
import java.util.Date;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.JoinColumn;
|
||||
import jakarta.persistence.OneToOne;
|
||||
import jakarta.persistence.SequenceGenerator;
|
||||
import jakarta.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "ACCOUNTS")
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
package com.baeldung.countrows.entity;
|
||||
|
||||
import javax.persistence.*;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.SequenceGenerator;
|
||||
import jakarta.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "PERMISSIONS")
|
||||
|
|
|
@ -4,13 +4,9 @@ import com.baeldung.countrows.entity.Account;
|
|||
import com.baeldung.countrows.entity.Permission;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public interface AccountRepository extends JpaRepository<Account, Integer> {
|
||||
|
|
|
@ -2,16 +2,10 @@ package com.baeldung.countrows.service;
|
|||
|
||||
import java.sql.Timestamp;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.PersistenceContext;
|
||||
import javax.persistence.Query;
|
||||
import javax.persistence.criteria.*;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
@ -20,6 +14,14 @@ import com.baeldung.countrows.entity.Permission;
|
|||
import com.baeldung.countrows.repository.AccountRepository;
|
||||
import com.baeldung.countrows.repository.PermissionRepository;
|
||||
|
||||
import jakarta.persistence.EntityManager;
|
||||
import jakarta.persistence.PersistenceContext;
|
||||
import jakarta.persistence.Query;
|
||||
import jakarta.persistence.criteria.CriteriaBuilder;
|
||||
import jakarta.persistence.criteria.CriteriaQuery;
|
||||
import jakarta.persistence.criteria.Predicate;
|
||||
import jakarta.persistence.criteria.Root;
|
||||
|
||||
@Service
|
||||
public class AccountStatsLogic {
|
||||
@Autowired
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package com.baeldung.dsrouting;
|
||||
|
||||
public enum ClientDatabase {
|
||||
|
||||
CLIENT_A, CLIENT_B
|
||||
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|||
|
||||
@SpringBootApplication
|
||||
public class LargeResultSetApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(LargeResultSetApplication.class, args);
|
||||
}
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
package com.baeldung.largeresultset;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.Id;
|
||||
|
||||
@Entity
|
||||
public class Student {
|
||||
|
|
|
@ -3,8 +3,6 @@ package com.baeldung.largeresultset.service;
|
|||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Slice;
|
||||
|
@ -14,6 +12,8 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
import com.baeldung.largeresultset.Student;
|
||||
import com.baeldung.largeresultset.StudentRepository;
|
||||
|
||||
import jakarta.persistence.EntityManager;
|
||||
|
||||
@Service
|
||||
public class StudentService {
|
||||
private static final int BATCH_SIZE = 5;
|
||||
|
|
|
@ -4,9 +4,7 @@ import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
|
|||
|
||||
import java.sql.Timestamp;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.Instant;
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
|
|
Loading…
Reference in New Issue