Interface RepositoryGenerator

All Known Implementing Classes:
BaseRepositoryGenerator

public interface RepositoryGenerator
Specific data repository (e.g. Jakarta Data, Micronaut Data, ...) generator. Defines generated data repository interfaces implementations.
  • Method Details

    • annotations

      Set<TypeName> annotations()
      Supported data repository annotations for repository code processing and generation.
      Returns:
      supported annotations
    • interfaces

      Set<TypeName> interfaces()
      Supported data repository interfaces for repository code processing and generation.
      Returns:
      supported interfaces
    • createRepositoryInfo

      RepositoryInfo createRepositoryInfo(TypeInfo interfaceInfo, CodegenContext codegenContext)
      Create data repository interface descriptor (info). Contains list of provider specific interfaces to be implemented and entity and ID types.
      Parameters:
      interfaceInfo - data repository interface type information
      codegenContext - code processing and generation context
      Returns:
      data repository interface descriptor
    • genericInterface

      RepositoryInterfaceInfo genericInterface(Map<TypeName,RepositoryInterfaceInfo> interfacesInfo)
      Return the most generic provider specific interface from provided interfaces.
      Parameters:
      interfacesInfo - data repository implemented interfaces Map.
      Returns:
      the most generic interface
    • generateInterfaces

      void generateInterfaces(RepositoryInfo repositoryInfo, ClassModel.Builder classModel, CodegenContext codegenContext, PersistenceGenerator persistenceGenerator)
      Generate repository interfaces (e.g. CrudRepository) methods.
      Parameters:
      repositoryInfo - data repository interface info
      classModel - target class builder
      codegenContext - code processing and generation context
      persistenceGenerator - persistence provider specific generator
    • generateQueryMethods

      void generateQueryMethods(RepositoryInfo repositoryInfo, ClassModel.Builder classModel, CodegenContext codegenContext, PersistenceGenerator persistenceGenerator)
      Generate query by method name methods.
      Parameters:
      repositoryInfo - data repository interface info
      classModel - target class builder
      codegenContext - code processing and generation context
      persistenceGenerator - persistence provider specific generator