Package no.sikt.graphitron.generators.db
Class EntityDBFetcherMethodGenerator
java.lang.Object
no.sikt.graphitron.generators.abstractions.AbstractSchemaMethodGenerator<T,ObjectDefinition>
no.sikt.graphitron.generators.abstractions.DBMethodGenerator<ObjectField>
no.sikt.graphitron.generators.db.FetchDBMethodGenerator
no.sikt.graphitron.generators.db.EntityDBFetcherMethodGenerator
- All Implemented Interfaces:
MethodGenerator
This class generates the queries needed to resolve entities.
-
Field Summary
Fields inherited from class no.sikt.graphitron.generators.db.FetchDBMethodGenerator
isRoot, resolverKeyParamNameFields inherited from class no.sikt.graphitron.generators.abstractions.AbstractSchemaMethodGenerator
dependencyMap, localObject, processedSchema -
Constructor Summary
ConstructorsConstructorDescriptionEntityDBFetcherMethodGenerator(ObjectDefinition localObject, ProcessedSchema processedSchema) -
Method Summary
Modifier and TypeMethodDescriptionprotected CodeBlockformatWhere(FetchContext context) generate(ObjectField target) protected CodeBlockgenerateSelectRow(FetchContext context) This method recursively generates one single row method call.protected CodeBlockgetSelectCode(GenerationField field, FetchContext context) Methods inherited from class no.sikt.graphitron.generators.db.FetchDBMethodGenerator
createAliasDeclarations, createAliasDeclarations, createMapping, createOrderFieldsBlock, createOrderFieldsDeclarationBlock, createSeekAndLimitBlock, createSelectConditions, createSelectJoins, formatWhereContents, generateCorrelatedSubquery, generateForScalarField, generateForScalarField, generateForUnionField, getInitialKey, getInputConditions, getSelectCodeAndFieldSource, getSpecBuilder, inferFieldNamingConvention, wrapInField, wrapInMultisetMethods inherited from class no.sikt.graphitron.generators.abstractions.DBMethodGenerator
getContextParameters, getDefaultSpecBuilder, getMethodParameters, getMethodParametersWithOrderField, iterableWrapTypeMethods inherited from class no.sikt.graphitron.generators.abstractions.AbstractSchemaMethodGenerator
getDataFetcherWiring, getDependencyMap, getLocalObject, getLocalTable, getTypeResolverWiring, inferFieldTypeName
-
Constructor Details
-
EntityDBFetcherMethodGenerator
public EntityDBFetcherMethodGenerator(ObjectDefinition localObject, ProcessedSchema processedSchema)
-
-
Method Details
-
generate
- Specified by:
generatein classAbstractSchemaMethodGenerator<ObjectField,ObjectDefinition> - Returns:
- The complete javapoet
MethodSpecbased on the provided target.
-
formatWhere
- Returns:
- Formatted CodeBlock for the where-statement and surrounding code. Applies conditions and joins.
-
generateSelectRow
This method recursively generates one single row method call. It deduces how each layer of row call should be structured by keeping track of joins and following field references.- Overrides:
generateSelectRowin classFetchDBMethodGenerator- Returns:
- Code block which contains the entire recursive structure of the row statement.
-
getSelectCode
-
generateAll
- Returns:
- List of complete javapoet
MethodSpecthat can be generated for this object.
-