Class BaseJpaRepository
java.lang.Object
com.reallifedeveloper.common.infrastructure.persistence.BaseJpaRepository
Base class for implementations of repositories that use JPA but that cannot use Spring Data, e.g., because they work with more than one
entity type.
- Author:
- RealLifeDeveloper
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Creates a newBaseJpaRepository
, intended to be used by sub-classes. -
Method Summary
Modifier and TypeMethodDescriptiongetQueryString
(String methodName, Class<?>... parameterTypes) Gives the value of the@Query
annotation on the given method.
-
Constructor Details
-
BaseJpaRepository
protected BaseJpaRepository()Creates a newBaseJpaRepository
, intended to be used by sub-classes.
-
-
Method Details
-
getQueryString
Gives the value of the@Query
annotation on the given method. The annotation can be on the method in the class, or on the method in an implemented interface.- Parameters:
methodName
- the name of the method with the@Query
annotationparameterTypes
- the classes of the method parameters- Returns:
- the query string, i.e., the value of the
@Query
annotation, or an empty Optional if no such annotation can be found
-