{"record":{"id":"9c9a5ef72b454884","repo":"hibernate/hibernate-orm","slug":"no-generator-type-specified-by-genericgenerator","errorCode":null,"errorMessage":"No generator type specified by @GenericGenerator","messagePattern":"No generator type specified by @GenericGenerator","errorType":"exception","errorClass":"MappingException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/id/GenericGeneratorGeneration.java","lineNumber":83,"sourceCode":"\t\tif ( delegate.requiresIdentityColumn() ) {\n\t\t\tsetColumnToIdentity( context.getValue() );\n\t\t}\n\t}\n\n\tprivate static Class<? extends Generator> generatorType(\n\t\t\tGenericGenerator annotation,\n\t\t\tGeneratorCreationContext context) {\n\t\tfinal var type = annotation.type();\n\t\tif ( type != null ) {\n\t\t\treturn type;\n\t\t}\n\t\telse if ( annotation instanceof GenericGeneratorAnnotation generatorAnnotation\n\t\t\t\t&& generatorAnnotation.strategy() != null\n\t\t\t\t&& context.getValue() instanceof SimpleValue idValue ) {\n\t\t\treturn generatorClass( generatorAnnotation.strategy(), idValue );\n\t\t}\n\t\telse {\n\t\t\tthrow new MappingException( \"No generator type specified by @GenericGenerator\" );\n\t\t}\n\t}\n\n\tprivate void configure(GenericGenerator annotation, GeneratorCreationContext context) {\n\t\tif ( delegate instanceof Configurable configurable ) {\n\t\t\tconfigurable.configure( context, collectParameters( annotation, context ) );\n\t\t}\n\t\tif ( delegate instanceof ExportableProducer exportableProducer ) {\n\t\t\texportableProducer.registerExportables( context.getDatabase() );\n\t\t}\n\t\tif ( delegate instanceof Configurable configurable ) {\n\t\t\tconfigurable.initialize( context.getSqlStringGenerationContext() );\n\t\t}\n\t}\n\n\tprivate static Properties collectParameters(\n\t\t\tGenericGenerator annotation,\n\t\t\tGeneratorCreationContext context) {","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/id/GenericGeneratorGeneration.java#L65-L101","documentation":"Error \"No generator type specified by @GenericGenerator\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Thrown when a @GenericGenerator mapping is incomplete or references a generator that cannot be resolved.","commonSituations":"Typical situations: missing type/strategy attribute on @GenericGenerator; misspelled generator strategy name.","solutions":["Specify the 'type' (strategy) of the @GenericGenerator so Hibernate knows which generator class to use."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}