Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Upgraded dependencies for spring-data-repo-4 module, especially sprin… #18075

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 10 additions & 40 deletions persistence-modules/spring-data-jpa-repo-4/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,20 @@

<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>
<dependency>
<groupId>jakarta.persistence</groupId>
<artifactId>jakarta.persistence-api</artifactId>
<version>${jakarta.persistence-api.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
Expand All @@ -37,21 +32,13 @@
</dependency>
<dependency>
<groupId>io.hypersistence</groupId>
<artifactId>hypersistence-utils-hibernate-55</artifactId>
<version>${hypersistance-utils-hibernate-55.version}</version>
<artifactId>hypersistence-utils-hibernate-60</artifactId>
<version>${hypersistance-utils-hibernate-60.version}</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
</dependency>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-jpa</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
Expand Down Expand Up @@ -96,23 +83,6 @@

<build>
<plugins>
<plugin>
<groupId>com.mysema.maven</groupId>
<artifactId>apt-maven-plugin</artifactId>
<version>1.1.3</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>process</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
<processor>com.querydsl.apt.jpa.JPAAnnotationProcessor</processor>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
Expand All @@ -136,20 +106,20 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
<version>5.6.11.Final</version>
<version>6.6.1.Final</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>

<properties>
<hypersistance-utils-hibernate-55.version>3.7.0</hypersistance-utils-hibernate-55.version>
<postgresql.version>42.7.1</postgresql.version>
<hypersistance-utils-hibernate-60.version>3.9.0</hypersistance-utils-hibernate-60.version>
<postgresql.version>42.7.4</postgresql.version>
<db.util.version>1.0.7</db.util.version>
<hypersistence-utils.version>3.7.0</hypersistence-utils.version>
<jakarta.persistence-api.version>3.1.0</jakarta.persistence-api.version>
<lombok.version>1.18.34</lombok.version>
<hypersistence-utils.version>3.9.0</hypersistence-utils.version>
<lombok.version>1.18.36</lombok.version>
<start-class>com.baeldung.spring.data.noconverterfound.NoConverterFoundApplication</start-class>
</properties>

</project>
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.baeldung.spring.data.noconverterfound.models;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;

@Entity
public class Employee {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.baeldung.spring.data.noconverterfound.repositories;

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 com.baeldung.spring.data.noconverterfound.models.Employee;
Expand All @@ -10,7 +12,8 @@
@Repository
public interface EmployeeRepository extends JpaRepository<Employee, Integer> {

EmployeeFullName findEmployeeFullNameById(int id);
@Query("SELECT new com.baeldung.spring.data.noconverterfound.models.EmployeeFullName(e.firstName, e.lastName) FROM Employee e WHERE e.id = :id")
EmployeeFullName findEmployeeFullNameById(@Param("id") int id);

IEmployeeFullName findIEmployeeFullNameById(int id);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.OneToMany;
import jakarta.persistence.OneToOne;
import jakarta.persistence.Table;

@Entity
@Table(name = "group")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.baeldung.spring.data.persistence.findvsget.entity;

import java.util.Objects;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;

@Entity
@Table(name = "users")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;

import javax.persistence.AttributeConverter;
import javax.persistence.Converter;
import jakarta.persistence.AttributeConverter;
import jakarta.persistence.Converter;

@Converter
@Slf4j
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package com.baeldung.spring.data.persistence.json;

import javax.persistence.*;
import jakarta.persistence.*;

import io.hypersistence.utils.hibernate.type.json.JsonBinaryType;
import lombok.*;
import org.hibernate.annotations.JdbcTypeCode;
import org.hibernate.annotations.Type;
import org.hibernate.annotations.TypeDef;
import org.hibernate.type.SqlTypes;

@Entity
@Table(name = "student")
Expand All @@ -14,7 +15,6 @@
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(of = {"id"})
@TypeDef(name = "jsonb", typeClass = JsonBinaryType.class)
public class StudentEntity {

@Id
Expand All @@ -24,7 +24,8 @@ public class StudentEntity {
@Column(name = "admit_year", length = 4)
private String admitYear;

@Type(type = "jsonb")
@Type(JsonBinaryType.class)
@JdbcTypeCode(SqlTypes.JSON)
@Column(name = "address", columnDefinition = "jsonb")
private Address address;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.baeldung.spring.data.persistence.json;

import javax.persistence.*;
import jakarta.persistence.*;

import lombok.*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import jakarta.persistence.EntityManager;
import jakarta.persistence.PersistenceContext;
import jakarta.persistence.Query;

@Repository
public class EntityManagerRepository {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.baeldung.spring.data.persistence.truncate;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import java.util.Objects;

@Entity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.baeldung.spring.data.persistence.truncate;

import jakarta.transaction.Transactional;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import javax.transaction.Transactional;

@Repository
public interface MyEntityRepository extends CrudRepository<MyEntity, Long> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import jakarta.persistence.CascadeType;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.OneToMany;

@Entity
public class Article {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;

@Entity
public class Comment {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.baeldung.spring.insertableonly.entitymanager;

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 EntityManagerBook {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.baeldung.spring.insertableonly.entitymanager;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.transaction.Transactional;
import jakarta.persistence.EntityManager;
import jakarta.persistence.PersistenceContext;
import jakarta.transaction.Transactional;

public class PersistableEntityManagerBookRepositoryImpl<S> implements PersistableEntityManagerBookRepository<S> {
@PersistenceContext
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.baeldung.spring.insertableonly.persistable;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import org.springframework.data.domain.Persistable;

@Entity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.baeldung.spring.insertableonly.query;

import javax.persistence.Entity;
import javax.persistence.Id;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;

@Entity
public class CustomQueryBook {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.baeldung.spring.insertableonly.query;

import javax.transaction.Transactional;
import jakarta.transaction.Transactional;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.baeldung.spring.insertableonly.repositorycheck;

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 RepositoryCheckBook {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.baeldung.spring.insertableonly.simple;

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 SimpleBook {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.baeldung.spring.insertableonly.unpadatable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;

@Entity
public class UnapdatableBook {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.baeldung.spring.notamanagedtype.missedannotation;

import javax.persistence.Id;
import jakarta.persistence.Id;

public class EntityWithoutAnnotation {
@Id
Expand Down
Loading