-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42705 from aureamunoz/issue-spring-jpa-34395
Fix for resolving entity fields based on collections and generics
- Loading branch information
Showing
6 changed files
with
102 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...ta-jpa/deployment/src/test/java/io/quarkus/spring/data/deployment/generics/ChildBase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package io.quarkus.spring.data.deployment.generics; | ||
|
||
import jakarta.persistence.MappedSuperclass; | ||
|
||
@MappedSuperclass | ||
public class ChildBase { | ||
String nombre; | ||
String detail; | ||
} |
17 changes: 17 additions & 0 deletions
17
...a-jpa/deployment/src/test/java/io/quarkus/spring/data/deployment/generics/ParentBase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.quarkus.spring.data.deployment.generics; | ||
|
||
import java.util.List; | ||
|
||
import jakarta.persistence.CascadeType; | ||
import jakarta.persistence.MappedSuperclass; | ||
import jakarta.persistence.OneToMany; | ||
|
||
@MappedSuperclass | ||
public class ParentBase<T extends ChildBase> { | ||
String name; | ||
String detail; | ||
int age; | ||
float test; | ||
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true) | ||
private List<T> children; | ||
} |
7 changes: 7 additions & 0 deletions
7
...oyment/src/test/java/io/quarkus/spring/data/deployment/generics/ParentBaseRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package io.quarkus.spring.data.deployment.generics; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface ParentBaseRepository<T extends ParentBase<?>> extends JpaRepository<T, Long> { | ||
long countParentsByChildren_Nombre(String name); | ||
} |