Class BaseRepositoryGenerator
java.lang.Object
io.helidon.data.codegen.common.BaseRepositoryGenerator
- All Implemented Interfaces:
RepositoryGenerator
Base implementation for Data repository generators such as Jakarta Data.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interfaceRepository interface generator factory. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates an instance of specific data repository generator base class. -
Method Summary
Modifier and TypeMethodDescriptioncreateRepositoryInfo(TypeInfo interfaceInfo, CodegenContext codegenContext) Creates metadata for a Data repository interface.static booleanhasInterface(TypeInfo interfaceInfo, TypeName interfaceName) Searches forinterfaceNamein the interface hierarchy represented byTypeInfo.protected abstract RepositoryInfo.BuilderrepositoryInfoBuilder(CodegenContext codegenContext) Data repository specific repository interface info builder (RepositoryInfo.Builder).Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface RepositoryGenerator
annotations, generateInterfaces, generateQueryMethods, genericInterface, interfacesModifier and TypeMethodDescriptionSupported data repository annotations for repository code processing and generation.voidgenerateInterfaces(RepositoryInfo repositoryInfo, ClassModel.Builder classModel, CodegenContext codegenContext, PersistenceGenerator persistenceGenerator) Generate repository interfaces (e.g.voidgenerateQueryMethods(RepositoryInfo repositoryInfo, ClassModel.Builder classModel, CodegenContext codegenContext, PersistenceGenerator persistenceGenerator) Generate query by method name methods.genericInterface(Map<TypeName, RepositoryInterfaceInfo> interfacesInfo) Return the most generic provider specific interface from provided interfaces.Supported data repository interfaces for repository code processing and generation.
-
Constructor Details
-
BaseRepositoryGenerator
protected BaseRepositoryGenerator()Creates an instance of specific data repository generator base class.
-
-
Method Details
-
hasInterface
Searches forinterfaceNamein the interface hierarchy represented byTypeInfo.- Parameters:
interfaceInfo- interfaces hierarchy to walk throughinterfaceName- interface name to search for- Returns:
- value of
truewhen interfaces hierarchy containsinterfaceNameorfalseotherwise - Throws:
NullPointerException- ifinterfaceInfoorinterfaceNameisnull
-
createRepositoryInfo
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:
createRepositoryInfoin interfaceRepositoryGenerator- Parameters:
interfaceInfo- data repository interface typecodegenContext- code processing and generation context- Returns:
- data repository interface info
- Throws:
NullPointerException- ifinterfaceInfoorcodegenContextisnullCodegenException- if the repository interface hierarchy cannot be resolved
-
repositoryInfoBuilder
Data repository specific repository interface info builder (RepositoryInfo.Builder).- Parameters:
codegenContext- code processing and generation context- Returns:
- repository interface info builder
-