Class BaseRepositoryGenerator

java.lang.Object
io.helidon.data.codegen.common.BaseRepositoryGenerator
All Implemented Interfaces:
RepositoryGenerator

public abstract class BaseRepositoryGenerator extends Object implements RepositoryGenerator
Base implementation for Data repository generators such as Jakarta Data.
  • Constructor Details

    • BaseRepositoryGenerator

      protected BaseRepositoryGenerator()
      Creates an instance of specific data repository generator base class.
  • Method Details

    • hasInterface

      public static boolean hasInterface(TypeInfo interfaceInfo, TypeName interfaceName)
      Searches for interfaceName in the interface hierarchy represented by TypeInfo.
      Parameters:
      interfaceInfo - interfaces hierarchy to walk through
      interfaceName - interface name to search for
      Returns:
      value of true when interfaces hierarchy contains interfaceName or false otherwise
      Throws:
      NullPointerException - if interfaceInfo or interfaceName is null
    • createRepositoryInfo

      public RepositoryInfo createRepositoryInfo(TypeInfo interfaceInfo, CodegenContext codegenContext)
      Creates metadata for a Data repository interface. Generic parent interfaces are resolved from the repository use site so their concrete entity and identifier types are retained.
      Specified by:
      createRepositoryInfo in interface RepositoryGenerator
      Parameters:
      interfaceInfo - data repository interface type
      codegenContext - code processing and generation context
      Returns:
      data repository interface info
      Throws:
      NullPointerException - if interfaceInfo or codegenContext is null
      CodegenException - if the repository interface hierarchy cannot be resolved
    • repositoryInfoBuilder

      protected abstract RepositoryInfo.Builder repositoryInfoBuilder(CodegenContext codegenContext)
      Data repository specific repository interface info builder (RepositoryInfo.Builder).
      Parameters:
      codegenContext - code processing and generation context
      Returns:
      repository interface info builder