Class GenerateServerCodeExtension
- All Implemented Interfaces:
com.graphql_java_generator.plugin.conf.CommonConfiguration,com.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration,com.graphql_java_generator.plugin.conf.GenerateServerCodeConfiguration
- Direct Known Subclasses:
GraphQLExtension
public class GenerateServerCodeExtension extends GenerateCodeCommonExtension implements com.graphql_java_generator.plugin.conf.GenerateServerCodeConfiguration
-
Field Summary
Fields Modifier and Type Field Description java.lang.StringjavaTypeForIDTypeThe javaTypeForIDType is the java class that is used in the generated code for GraphQL fields that are of the GraphQL ID type.Fields inherited from class com.graphql_java_generator.gradleplugin.GenerateCodeCommonExtension
targetResourceFolder, targetSourceFolderFields inherited from class com.graphql_java_generator.gradleplugin.CommonExtension
project, skipGenerationIfSchemaHasNotChangedFields inherited from interface com.graphql_java_generator.plugin.conf.CommonConfiguration
DEFAULT_ADD_RELAY_CONNECTIONS, DEFAULT_MAX_TOKENS, DEFAULT_PACKAGE_NAME, DEFAULT_SCHEMA_FILE_FOLDER, DEFAULT_SCHEMA_FILE_PATTERN, DEFAULT_SKIP_GENERATION_IF_SCHEMA_HAS_NOT_CHANGEDFields inherited from interface com.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
DEFAULT_COPY_RUNTIME_SOURCES, DEFAULT_SEPARATE_UTIL_CLASSES, DEFAULT_SOURCE_ENCODING, DEFAULT_SPRING_BEAN_SUFFIX, DEFAULT_TARGET_RESOURCE_FOLDER, DEFAULT_TARGET_SOURCE_FOLDERFields inherited from interface com.graphql_java_generator.plugin.conf.GenerateServerCodeConfiguration
DEFAULT_GENERATE_BATCH_LOADER_ENVIRONMENT, DEFAULT_GENERATE_DATA_LOADER_FOR_LISTS, DEFAULT_GENERATE_JPA_ANNOTATION, DEFAULT_JAVA_TYPE_FOR_ID_TYPE, DEFAULT_SCAN_BASE_PACKAGES, DEFAULT_SCHEMA_PERSONALIZATION_FILE -
Constructor Summary
Constructors Constructor Description GenerateServerCodeExtension(org.gradle.api.Project project) -
Method Summary
Modifier and Type Method Description java.lang.StringgetJavaTypeForIDType()com.graphql_java_generator.plugin.conf.PluginModegetMode()The mode is forced toPluginMode.servercom.graphql_java_generator.plugin.conf.PackaginggetPackaging()java.lang.StringgetQuotedScanBasePackages()java.lang.StringgetScanBasePackages()java.io.FilegetSchemaPersonalizationFile()booleanisGenerateBatchLoaderEnvironment()booleanisGenerateDataLoaderForLists()booleanisGenerateJPAAnnotation()voidsetGenerateBatchLoaderEnvironment(boolean generateBatchLoaderEnvironment)voidsetGenerateDataLoaderForLists(boolean generateDataLoaderForLists)voidsetGenerateJPAAnnotation(boolean generateJPAAnnotation)voidsetJavaTypeForIDType(java.lang.String javaTypeForIDType)voidsetScanBasePackages(java.lang.String scanBasePackages)voidsetSchemaPersonalizationFile(java.lang.String schemaPersonalizationFile)Methods inherited from class com.graphql_java_generator.gradleplugin.GenerateCodeCommonExtension
getCustomScalars, getPackageName, getSourceEncoding, getSpringBeanSuffix, getTargetClassFolder, getTargetResourceFolder, getTargetSourceFolder, isCopyRuntimeSources, isSeparateUtilityClasses, setCopyRuntimeSources, setCustomScalars, setPackageName, setSeparateUtilityClasses, setSourceEncoding, setSpringBeanSuffix, setTargetResourceFolder, setTargetSourceFolderMethods inherited from class com.graphql_java_generator.gradleplugin.CommonExtension
getMaxTokens, getProjectDir, getSchemaFileFolder, getSchemaFilePattern, getTemplates, isAddRelayConnections, isInitialized, isSkipGenerationIfSchemaHasNotChanged, logConfiguration, setAddRelayConnections, setInitialized, setMaxTokens, setSchemaFileFolder, setSchemaFilePattern, setSkipGenerationIfSchemaHasNotChanged, setTemplatesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.graphql_java_generator.plugin.conf.CommonConfiguration
getDefaultTargetSchemaFileName, getMaxTokens, getProjectDir, getSchemaFileFolder, getSchemaFilePattern, getTemplates, isAddRelayConnections, isSkipGenerationIfSchemaHasNotChanged, logCommonConfigurationMethods inherited from interface com.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
getCustomScalars, getPackageName, getSourceEncoding, getSpringAutoConfigurationPackage, getSpringBeanSuffix, getTargetClassFolder, getTargetResourceFolder, getTargetSourceFolder, isCopyRuntimeSources, isGenerateUtilityClasses, isSeparateUtilityClasses, logGenerateCodeCommonConfiguration
-
Field Details
-
javaTypeForIDType
public java.lang.String javaTypeForIDTypeThe javaTypeForIDType is the java class that is used in the generated code for GraphQL fields that are of the GraphQL ID type. The default value is java.util.UUID. Valid values are: java.lang.String, java.lang.Long and java.util.UUID.
This parameter is only valid for the server mode. When generating the client code, the ID is always generated as a String type, as recommended in the GraphQL doc.
In other words: when in server mode and javaTypeForIDType is not set, all GraphQL ID fields are UUID attributes in java. When in server mode and javaTypeForIDType is set to the X type, all GraphQL ID fields are X attributes in java.
Note: you can override this, by using the schema personalization capability. For more information, please have a look at the Schema Personalization doc page.
-
-
Constructor Details
-
GenerateServerCodeExtension
public GenerateServerCodeExtension(org.gradle.api.Project project)
-
-
Method Details
-
isGenerateBatchLoaderEnvironment
public boolean isGenerateBatchLoaderEnvironment()- Specified by:
isGenerateBatchLoaderEnvironmentin interfacecom.graphql_java_generator.plugin.conf.GenerateServerCodeConfiguration
-
setGenerateBatchLoaderEnvironment
public void setGenerateBatchLoaderEnvironment(boolean generateBatchLoaderEnvironment) -
isGenerateJPAAnnotation
public boolean isGenerateJPAAnnotation()- Specified by:
isGenerateJPAAnnotationin interfacecom.graphql_java_generator.plugin.conf.GenerateServerCodeConfiguration
-
setGenerateJPAAnnotation
public void setGenerateJPAAnnotation(boolean generateJPAAnnotation) -
isGenerateDataLoaderForLists
public boolean isGenerateDataLoaderForLists()- Specified by:
isGenerateDataLoaderForListsin interfacecom.graphql_java_generator.plugin.conf.GenerateServerCodeConfiguration
-
setGenerateDataLoaderForLists
public final void setGenerateDataLoaderForLists(boolean generateDataLoaderForLists) -
getJavaTypeForIDType
public java.lang.String getJavaTypeForIDType()- Specified by:
getJavaTypeForIDTypein interfacecom.graphql_java_generator.plugin.conf.GenerateServerCodeConfiguration
-
setJavaTypeForIDType
public void setJavaTypeForIDType(java.lang.String javaTypeForIDType) -
getMode
public com.graphql_java_generator.plugin.conf.PluginMode getMode()The mode is forced toPluginMode.server- Specified by:
getModein interfacecom.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration- Overrides:
getModein classGenerateCodeCommonExtension
-
getPackaging
public com.graphql_java_generator.plugin.conf.Packaging getPackaging()- Specified by:
getPackagingin interfacecom.graphql_java_generator.plugin.conf.GenerateServerCodeConfiguration
-
getQuotedScanBasePackages
public java.lang.String getQuotedScanBasePackages()- Specified by:
getQuotedScanBasePackagesin interfacecom.graphql_java_generator.plugin.conf.GenerateServerCodeConfiguration
-
getScanBasePackages
public java.lang.String getScanBasePackages()- Specified by:
getScanBasePackagesin interfacecom.graphql_java_generator.plugin.conf.GenerateServerCodeConfiguration
-
setScanBasePackages
public void setScanBasePackages(java.lang.String scanBasePackages) -
getSchemaPersonalizationFile
public java.io.File getSchemaPersonalizationFile()- Specified by:
getSchemaPersonalizationFilein interfacecom.graphql_java_generator.plugin.conf.GenerateServerCodeConfiguration
-
setSchemaPersonalizationFile
public void setSchemaPersonalizationFile(java.lang.String schemaPersonalizationFile)
-