java.lang.Object
com.reallifedeveloper.common.infrastructure.persistence.BaseJpaRepository

public class BaseJpaRepository extends Object
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 Details

    • BaseJpaRepository

      protected BaseJpaRepository()
      Creates a new BaseJpaRepository, intended to be used by sub-classes.
  • Method Details

    • getQueryString

      protected Optional<String> getQueryString(String methodName, Class<?>... parameterTypes)
      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 annotation
      parameterTypes - 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