Class RecordObjectDefinition<T extends graphql.language.TypeDefinition<T>,U extends GenerationField>
java.lang.Object
no.sikt.graphitron.definitions.objects.AbstractObjectDefinition<T,U>
no.sikt.graphitron.definitions.objects.RecordObjectDefinition<T,U>
- All Implemented Interfaces:
GenerationTarget,ObjectSpecification<U>,RecordObjectSpecification<U>
- Direct Known Subclasses:
InputDefinition,ObjectDefinition
public abstract class RecordObjectDefinition<T extends graphql.language.TypeDefinition<T>,U extends GenerationField>
extends AbstractObjectDefinition<T,U>
implements RecordObjectSpecification<U>
A generalized implementation of
ObjectSpecification for types that can be linked to tables or records.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasSourceClassName(boolean toRecord) asTargetClassName(boolean toRecord) Class<?>protected LinkedHashSet<String>getTable()booleanbooleanbooleanbooleanbooleanhasTable()booleanisEntity()booleanDoes this have theGenerationDirective.NOT_GENERATEDdirective for skipping generation set?booleanbooleanprotected booleanisNonNullable(GenerationField field) Methods inherited from class no.sikt.graphitron.definitions.objects.AbstractObjectDefinition
createFields, equals, getClassReference, getFieldByName, getFields, getGraphClassName, getName, getObjectDefinition, hasField, hashCode, isOperationRootMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface no.sikt.graphitron.definitions.interfaces.ObjectSpecification
getClassReference, getFieldByName, getFields, getGraphClassName, getName, isOperationRoot
-
Constructor Details
-
RecordObjectDefinition
-
-
Method Details
-
isNonNullable
- Returns:
- Is this field non-nullable in the database?
-
isGenerated
public boolean isGenerated()- Specified by:
isGeneratedin interfaceGenerationTarget- Returns:
- Should this object be generated?
-
isGeneratedWithResolver
public boolean isGeneratedWithResolver()- Specified by:
isGeneratedWithResolverin interfaceGenerationTarget- Returns:
- Should this object be generated as or containing resolvers?
-
isExplicitlyNotGenerated
public boolean isExplicitlyNotGenerated()Description copied from interface:GenerationTargetDoes this have theGenerationDirective.NOT_GENERATEDdirective for skipping generation set?- Specified by:
isExplicitlyNotGeneratedin interfaceGenerationTarget
-
getTable
- Specified by:
getTablein interfaceRecordObjectSpecification<T extends graphql.language.TypeDefinition<T>>- Returns:
- Table objects which holds table names.
-
hasTable
public boolean hasTable()- Specified by:
hasTablein interfaceRecordObjectSpecification<T extends graphql.language.TypeDefinition<T>>- Returns:
- Does this object have the "
table" directive which implies a connection to a database table?
-
getRecordReference
- Specified by:
getRecordReferencein interfaceRecordObjectSpecification<T extends graphql.language.TypeDefinition<T>>- Returns:
- The reference for a record class for this input type.
-
getRecordReferenceName
- Specified by:
getRecordReferenceNamein interfaceRecordObjectSpecification<T extends graphql.language.TypeDefinition<T>>- Returns:
- The reference name for a record class for this input type.
-
getRecordClassName
- Specified by:
getRecordClassNamein interfaceRecordObjectSpecification<T extends graphql.language.TypeDefinition<T>>- Returns:
- The
ClassNamefor the record that corresponds to this type.
-
hasJavaRecordReference
public boolean hasJavaRecordReference()- Specified by:
hasJavaRecordReferencein interfaceRecordObjectSpecification<T extends graphql.language.TypeDefinition<T>>- Returns:
- Does this input type have a record java class attached?
-
hasRecordReference
public boolean hasRecordReference()- Specified by:
hasRecordReferencein interfaceRecordObjectSpecification<T extends graphql.language.TypeDefinition<T>>- Returns:
- Does this input type have a record class attached?
-
asSourceClassName
- Specified by:
asSourceClassNamein interfaceRecordObjectSpecification<T extends graphql.language.TypeDefinition<T>>- Returns:
- The
ClassNamefor this object when it is considered the source of a mapping.
-
asTargetClassName
- Specified by:
asTargetClassNamein interfaceRecordObjectSpecification<T extends graphql.language.TypeDefinition<T>>- Returns:
- The
ClassNamefor this object when it is considered the target of a mapping.
-
asRecordName
- Specified by:
asRecordNamein interfaceRecordObjectSpecification<T extends graphql.language.TypeDefinition<T>>- Returns:
- The name of this object once it is transformed into a record.
-
getInputsSortedByNullability
- Returns:
- List of input fields contained within this input type, sorted by whether they are nullable fields.
-
getRequiredInputs
-
isEntity
public boolean isEntity()- Specified by:
isEntityin interfaceRecordObjectSpecification<T extends graphql.language.TypeDefinition<T>>- Returns:
- Is this type an entity according to the Apollo Federation specification?
-
getEntityKeys
- Specified by:
getEntityKeysin interfaceRecordObjectSpecification<T extends graphql.language.TypeDefinition<T>>- Returns:
- Apollo federation entity keys for this type.
-
hasNodeDirective
public boolean hasNodeDirective()- Specified by:
hasNodeDirectivein interfaceRecordObjectSpecification<T extends graphql.language.TypeDefinition<T>>
-
getTypeId
- Specified by:
getTypeIdin interfaceRecordObjectSpecification<T extends graphql.language.TypeDefinition<T>>
-
hasCustomKeyColumns
public boolean hasCustomKeyColumns()- Specified by:
hasCustomKeyColumnsin interfaceRecordObjectSpecification<T extends graphql.language.TypeDefinition<T>>
-
getKeyColumns
- Specified by:
getKeyColumnsin interfaceRecordObjectSpecification<T extends graphql.language.TypeDefinition<T>>
-