Package io.helidon.data.codegen.common
Class BaseRepositoryInterfaceGenerator
java.lang.Object
io.helidon.data.codegen.common.BaseGenerator
io.helidon.data.codegen.common.BaseRepositoryInterfaceGenerator
- All Implemented Interfaces:
RepositoryInterfaceGenerator
- Direct Known Subclasses:
BaseRepositoryMethodsGenerator
public abstract class BaseRepositoryInterfaceGenerator
extends BaseGenerator
implements RepositoryInterfaceGenerator
Data repository interface code generator base class.
-
Field Summary
Fields inherited from class io.helidon.data.codegen.common.BaseGenerator
BIG_DECIMAL, BIG_INTEGER, CLASS_WILDCARD, ENTITIES, ENTITY, EXECUTOR, GENERIC_T, GENERIC_WILDCARD, ID, ITERABLE_T, ITERABLE_T_ENTITIES, LIST_T, LIST_T_ENTITIES, NUMBER, OBJECT, T, T_ENTITY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseRepositoryInterfaceGenerator(RepositoryInfo repositoryInfo, ClassModel.Builder classModel, CodegenContext codegenContext, PersistenceGenerator persistenceGenerator) Creates an instance of data repository interface code generator base class. -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidcall(Method.Builder builder, Consumer<Method.Builder> content, String identifier) GenerateCallablecall.protected ClassModel.BuilderTarget implementing class model builder.protected CodegenContextCode processing and generation context.protected static TypeArgumentextendsType(String type, TypeName extended) Generate<type> extends <extended>generic type.protected voidmethodWarning(TypedElementInfo methodInfo, String message) Log method generation warning.protected static voidoptionalFromQuery(Method.Builder builder, Consumer<Method.Builder> content, TypeName executorType) Deprecated.will be removed with Jakarta Persistence 3.2protected static voidoptionalOfNullable(Method.Builder builder, Consumer<Method.Builder> content) GenerateOptional.ofNullable(Object)call.protected PersistenceGeneratorSpecific persistence provider generator.protected PersistenceGenerator.QueryBuilderQuery code builder from persistence provider generator.protected RepositoryInfoData repository interface info.protected static voidrun(Method.Builder builder, Consumer<Method.Builder> content, String identifier) GenerateRunnablerun.protected PersistenceGenerator.StatementGeneratorPersistence provider specific code snippets generator.Methods inherited from class io.helidon.data.codegen.common.BaseGenerator
decreasePadding, identifier, increasePadding, initializedVariable, nullValue, returnStatement, statement, throwException, throwException, valueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.helidon.data.codegen.common.RepositoryInterfaceGenerator
generate
-
Constructor Details
-
BaseRepositoryInterfaceGenerator
protected BaseRepositoryInterfaceGenerator(RepositoryInfo repositoryInfo, ClassModel.Builder classModel, CodegenContext codegenContext, PersistenceGenerator persistenceGenerator) Creates an instance of data repository interface code generator base class.- Parameters:
repositoryInfo- data repository interface infoclassModel- target class buildercodegenContext- code processing and generation contextpersistenceGenerator- persistence provider specific generator
-
-
Method Details
-
optionalOfNullable
GenerateOptional.ofNullable(Object)call.- Parameters:
builder- method buildercontent- additional statement content
-
optionalFromQuery
@Deprecated protected static void optionalFromQuery(Method.Builder builder, Consumer<Method.Builder> content, TypeName executorType) Deprecated.will be removed with Jakarta Persistence 3.2Generate<T> Optional<T> RepositoryExecutor#optionalFromQuery(List<T>)call. This is Jakarta Persistence 3.1 workaround.- Parameters:
builder- method buildercontent- additional statement contentexecutorType- repository executor type
-
call
protected static void call(Method.Builder builder, Consumer<Method.Builder> content, String identifier) GenerateCallablecall.- Parameters:
builder- method buildercontent- additional statement contentidentifier-Callableinstance identifier
-
run
protected static void run(Method.Builder builder, Consumer<Method.Builder> content, String identifier) GenerateRunnablerun.- Parameters:
builder- method buildercontent- additional statement contentidentifier-Callableinstance identifier
-
extendsType
Generate<type> extends <extended>generic type.- Parameters:
type- extending typeextended- type being extended- Returns:
extendsgeneric type
-
repositoryInfo
Data repository interface info.- Returns:
- data repository interface descriptor
-
classModel
Target implementing class model builder.- Returns:
- class model builder
-
codegenContext
Code processing and generation context.- Returns:
- codegen context
-
persistenceGenerator
Specific persistence provider generator. Repository interface implementing class is defined byPersistenceGeneratorbut it content (e.g. implemented data repository interfaces) are defined byRepositoryGeneratorwhich holds individual instances ofRepositoryInterfaceGeneratorclasses.PersistenceGeneratorprovides persistence provider specific code for data repository interface implementing code.- Returns:
- persistence provider generator
-
queryBuilder
Query code builder from persistence provider generator.- Returns:
- query code builder
-
statementGenerator
Persistence provider specific code snippets generator.- Returns:
- code snippets generator
-
methodWarning
Log method generation warning.- Parameters:
methodInfo- method infomessage- warning message
-