public class FetchingEagerEntityJoinHandler<T> implements EntityJoinHandler<T>
interface EntityJoinHandler
implementation to fetch all fields (entity fields and nested fields included) with Join Annotation defining FetchType.EAGER.
Technically, it creates a LEFT JOIN FETCH
in JPQL for Join Annotation with FetchType.EAGER.
Example: A
has a relationship with B
using @OneToMany
annotation and FetchType.EAGER
, and A
has a relationship with C
using @OneToMany
annotation and FetchType.LAZY
.When we search for A
, we retrieve A
with just data from B
, but not C
.
interface EntityJoinHandler
public FetchingEagerEntityJoinHandler()
interface EntityJoinHandler
implementation to fetch all fields (entity fields and nested fields included) with Join Annotation defining FetchType.EAGER.
Technically, it creates a LEFT JOIN FETCH
in JPQL for Join Annotation with FetchType.EAGER.
Example: A
has a relationship with B
using @OneToMany
annotation and FetchType.EAGER
, and A
has a relationship with C
using @OneToMany
annotation and FetchType.LAZY
.When we search for A
, we retrieve A
with just data from B
, but not C
.
interface EntityJoinHandler
public boolean supports(@NotNull java.lang.Class<?> entityClass, @NotNull java.lang.Class<?> fieldClass, @NotNull java.lang.String fieldName, @NotNull java.lang.annotation.Annotation joinAnnotation)
Checks if the given arguments are supported by this EntityJoinHandler.
@NotNull public JoinInfo handle(@NotNull java.lang.Class<?> entityClass, @NotNull java.lang.Class<?> fieldClass, @NotNull java.lang.String fieldName, @NotNull java.lang.annotation.Annotation joinAnnotation)
Handles the join type for the given arguments.
entityClass
- Class of the Entity beanfieldClass
- Class of the Field present on the EntityfieldName
- Name of the FieldjoinAnnotation
- Join Annotation present on the Entity Fieldclass JoinInfo