Replies: 3 comments 1 reply
-
Doesn't it already work with the following code ? public interface ProductDto {
String getName();
List<RatingDto> getRatings();
}
public interface RatingDto {
int getRating();
}
public interface BaseProductRepository<T extends AbstractProduct> extends Repository<T, String>, EntityGraphQuerydslPredicateExecutor<T> {
Optional<ProductDto> findById(String id, EntityGraph entityGraph);
} |
Beta Was this translation helpful? Give feedback.
-
Hmm, so I tried it that way, but first I got a ClassNotFoundException for the class MoreObjects in the class EntityGraphBean. After adding Google Guava to my own POM I get the following Exception:
|
Beta Was this translation helpful? Give feedback.
-
I see. |
Beta Was this translation helpful? Give feedback.
-
First of all, I think this project is a super useful and necessary addition to Spring Data JPA 👍 What I would like to accomplish right now is to use this for nested projections on lazily loaded 1-To-Many Relations.
Doing this without any entity graph usually ends in a LazyInitializationException. However annotating the projection method with an entity graph solves this issue, like so:
As I want to do this in a dynamic way, this project would suit my purposes perfectly, if you decided to add support.
Beta Was this translation helpful? Give feedback.
All reactions