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
ConstructorsModifierConstructorDescriptionprotected
BaseRepositoryInterfaceGenerator
(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 void
call
(Method.Builder builder, Consumer<Method.Builder> content, String identifier) GenerateCallable
call.protected ClassModel.Builder
Target implementing class model builder.protected CodegenContext
Code processing and generation context.protected static TypeArgument
extendsType
(String type, TypeName extended) Generate<type> extends <extended>
generic type.protected void
methodWarning
(TypedElementInfo methodInfo, String message) Log method generation warning.protected static void
optionalFromQuery
(Method.Builder builder, Consumer<Method.Builder> content, TypeName executorType) Deprecated.will be removed with Jakarta Persistence 3.2protected static void
optionalOfNullable
(Method.Builder builder, Consumer<Method.Builder> content) GenerateOptional.ofNullable(Object)
call.protected PersistenceGenerator
Specific persistence provider generator.protected PersistenceGenerator.QueryBuilder
Query code builder from persistence provider generator.protected RepositoryInfo
Data repository interface info.protected static void
run
(Method.Builder builder, Consumer<Method.Builder> content, String identifier) GenerateRunnable
run.protected PersistenceGenerator.StatementGenerator
Persistence provider specific code snippets generator.Methods inherited from class io.helidon.data.codegen.common.BaseGenerator
decreasePadding, identifier, increasePadding, initializedVariable, nullValue, returnStatement, statement, throwException, throwException, value
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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) GenerateCallable
call.- Parameters:
builder
- method buildercontent
- additional statement contentidentifier
-Callable
instance identifier
-
run
protected static void run(Method.Builder builder, Consumer<Method.Builder> content, String identifier) GenerateRunnable
run.- Parameters:
builder
- method buildercontent
- additional statement contentidentifier
-Callable
instance identifier
-
extendsType
Generate<type> extends <extended>
generic type.- Parameters:
type
- extending typeextended
- type being extended- Returns:
extends
generic 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 byPersistenceGenerator
but it content (e.g. implemented data repository interfaces) are defined byRepositoryGenerator
which holds individual instances ofRepositoryInterfaceGenerator
classes.PersistenceGenerator
provides 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
-