Class EntityDBFetcherMethodGenerator

All Implemented Interfaces:
MethodGenerator

public class EntityDBFetcherMethodGenerator extends FetchDBMethodGenerator
This class generates the queries needed to resolve entities.
  • Constructor Details

  • Method Details

    • generate

      public no.sikt.graphitron.javapoet.MethodSpec generate(ObjectField target)
      Specified by:
      generate in class AbstractSchemaMethodGenerator<ObjectField,ObjectDefinition>
      Returns:
      The complete javapoet MethodSpec based on the provided target.
    • formatWhere

      protected no.sikt.graphitron.javapoet.CodeBlock formatWhere(FetchContext context)
      Returns:
      Formatted CodeBlock for the where-statement and surrounding code. Applies conditions and joins.
    • generateSelectRow

      protected no.sikt.graphitron.javapoet.CodeBlock generateSelectRow(FetchContext context)
      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:
      generateSelectRow in class FetchDBMethodGenerator
      Returns:
      Code block which contains the entire recursive structure of the row statement.
    • getSelectCode

      protected no.sikt.graphitron.javapoet.CodeBlock getSelectCode(GenerationField field, FetchContext context)
    • generateAll

      public List<no.sikt.graphitron.javapoet.MethodSpec> generateAll()
      Returns:
      List of complete javapoet MethodSpec that can be generated for this object.