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- theJOOQMappingfor the table associated via@table. Should match the table of theRecordObjectDefinitionthis NodeConfiguration belongs to.keyColumnsJavaNames- from@node(keyColumns). Falls back to the table's primary key columns when omitted.hasCustomTypeId- whether the@nodedirective explicitly sets thetypeIdparameter.
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 Summary
ConstructorsConstructorDescriptionNodeConfiguration(graphql.language.TypeDefinition<?> objectDefinition, JOOQMapping table) NodeConfiguration(String typeId, JOOQMapping targetTable, List<String> keyColumnsJavaNames, boolean hasCustomTypeId) Creates an instance of aNodeConfigurationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.booleanReturns the value of thehasCustomTypeIdrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of thekeyColumnsJavaNamesrecord component.no.sikt.graphitron.javapoet.CodeBlockno.sikt.graphitron.javapoet.CodeBlocknodeIdFieldsWithTableVariableBlock(String tableVariable) Returns the value of thetargetTablerecord component.final StringtoString()Returns a string representation of this record class.typeId()Returns the value of thetypeIdrecord component.
-
Constructor Details
-
NodeConfiguration
-
NodeConfiguration
public NodeConfiguration(String typeId, JOOQMapping targetTable, List<String> keyColumnsJavaNames, boolean hasCustomTypeId) Creates an instance of aNodeConfigurationrecord class.- Parameters:
typeId- the value for thetypeIdrecord componenttargetTable- the value for thetargetTablerecord componentkeyColumnsJavaNames- the value for thekeyColumnsJavaNamesrecord componenthasCustomTypeId- the value for thehasCustomTypeIdrecord 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
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
typeId
Returns the value of thetypeIdrecord component.- Returns:
- the value of the
typeIdrecord component
-
targetTable
Returns the value of thetargetTablerecord component.- Returns:
- the value of the
targetTablerecord component
-
keyColumnsJavaNames
Returns the value of thekeyColumnsJavaNamesrecord component.- Returns:
- the value of the
keyColumnsJavaNamesrecord component
-
hasCustomTypeId
public boolean hasCustomTypeId()Returns the value of thehasCustomTypeIdrecord component.- Returns:
- the value of the
hasCustomTypeIdrecord component
-