Record Class NodeConfiguration

java.lang.Object
java.lang.Record
no.sikt.graphitron.definitions.helpers.NodeConfiguration
Record Components:
typeId - from @node(typeId). Defaults to the GraphQL type name when omitted.
targetTable - the JOOQMapping for the table associated via @table. Should match the table of the RecordObjectDefinition this NodeConfiguration belongs to.
keyColumnsJavaNames - from @node(keyColumns). Falls back to the table's primary key columns when omitted.
hasCustomTypeId - whether the @node directive explicitly sets the typeId parameter.

public record NodeConfiguration(String typeId, JOOQMapping targetTable, List<String> keyColumnsJavaNames, boolean hasCustomTypeId) extends Record
Configuration for a globally identifiable GraphQL object, derived from the @node and @table directives.
  • Constructor Details

    • NodeConfiguration

      public NodeConfiguration(graphql.language.TypeDefinition<?> objectDefinition, JOOQMapping table)
    • NodeConfiguration

      public NodeConfiguration(String typeId, JOOQMapping targetTable, List<String> keyColumnsJavaNames, boolean hasCustomTypeId)
      Creates an instance of a NodeConfiguration record class.
      Parameters:
      typeId - the value for the typeId record component
      targetTable - the value for the targetTable record component
      keyColumnsJavaNames - the value for the keyColumnsJavaNames record component
      hasCustomTypeId - the value for the hasCustomTypeId record component
  • Method Details

    • nodeIdFieldsWithStaticTableInstanceBlock

      public no.sikt.graphitron.javapoet.CodeBlock nodeIdFieldsWithStaticTableInstanceBlock()
      Returns:
      CodeBlock with comma-separated node ID fields using a static table instance. Example: Film.FILM.FILM_ID, Film.FILM.TITLE
    • nodeIdFieldsWithTableVariableBlock

      public no.sikt.graphitron.javapoet.CodeBlock nodeIdFieldsWithTableVariableBlock(String tableVariable)
      Returns:
      CodeBlock with comma-separated node ID fields using a table alias variable. Example: _a_film.FILM_ID, _a_film.TITLE
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • typeId

      public String typeId()
      Returns the value of the typeId record component.
      Returns:
      the value of the typeId record component
    • targetTable

      public JOOQMapping targetTable()
      Returns the value of the targetTable record component.
      Returns:
      the value of the targetTable record component
    • keyColumnsJavaNames

      public List<String> keyColumnsJavaNames()
      Returns the value of the keyColumnsJavaNames record component.
      Returns:
      the value of the keyColumnsJavaNames record component
    • hasCustomTypeId

      public boolean hasCustomTypeId()
      Returns the value of the hasCustomTypeId record component.
      Returns:
      the value of the hasCustomTypeId record component