Class FetchMappedObjectDBMethodGenerator

All Implemented Interfaces:
MethodGenerator
Direct Known Subclasses:
ServiceResultFetchDBMethodGenerator

public class FetchMappedObjectDBMethodGenerator extends FetchDBMethodGenerator
Generator that creates the default data fetching methods
  • Constructor Details

  • Method Details

    • generate

      public no.sikt.graphitron.javapoet.MethodSpec generate(ObjectField target)
      Specified by:
      generate in class AbstractSchemaMethodGenerator<ObjectField,ObjectDefinition>
      Parameters:
      target - A ObjectField for which a method should be generated for. This must reference an object with the "table" directive set.
      Returns:
      The complete javapoet MethodSpec based on the provided reference field.
    • getSelectBlockForRecord

      protected no.sikt.graphitron.javapoet.CodeBlock getSelectBlockForRecord(ObjectField target, no.sikt.graphitron.javapoet.CodeBlock selectRowBlock, boolean isReferenceResolverField, InputParser parser)
      Determine the select block to use for record types. By default, delegates to a helper method unless the field is a reference resolver field (which uses a correlated subquery). Subclasses can override to always inline the select.
    • generateAll

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