{"record":{"id":"24ccd8f228f312c2","repo":"hibernate/hibernate-orm","slug":"generatedvalue-for-s-s-specified-sequence-gen-24ccd8","errorCode":null,"errorMessage":"@GeneratedValue for %s (%s) specified SEQUENCE generation, but referred to a @GenericGenerator","messagePattern":"@GeneratedValue for (.+?) \\((.+?)\\) specified SEQUENCE generation, but referred to a @GenericGenerator","errorType":"exception","errorClass":"MappingException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/model/internal/IdGeneratorResolverSecondPass.java","lineNumber":122,"sourceCode":"\n\t\tfinal var globalRegistrations = buildingContext.getMetadataCollector().getGlobalRegistrations();\n\t\tfinal String generator = generatedValue.generator();\n\n\t\tfinal var globalTableMatch = globalRegistrations.getTableGeneratorRegistrations().get( generator );\n\t\tif ( globalTableMatch != null ) {\n\t\t\tthrow new MappingException(\n\t\t\t\t\tString.format(\n\t\t\t\t\t\t\tLocale.ROOT,\n\t\t\t\t\t\t\t\"@GeneratedValue for %s (%s) specified SEQUENCE generation, but referred to a @TableGenerator\",\n\t\t\t\t\t\t\tentityMapping.getEntityName(),\n\t\t\t\t\t\t\tgenerator\n\t\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tfinal var globalGenericMatch = globalRegistrations.getGenericGeneratorRegistrations().get( generator );\n\t\tif ( globalGenericMatch != null ) {\n\t\t\tthrow new MappingException(\n\t\t\t\t\tString.format(\n\t\t\t\t\t\t\tLocale.ROOT,\n\t\t\t\t\t\t\t\"@GeneratedValue for %s (%s) specified SEQUENCE generation, but referred to a @GenericGenerator\",\n\t\t\t\t\t\t\tentityMapping.getEntityName(),\n\t\t\t\t\t\t\tgenerator\n\t\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n\n\n\t// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\t// TABLE\n\n\t@Override\n\tprotected void handleUnnamedTableGenerator() {\n\t\t// todo (7.0) : null or entityMapping.getJpaEntityName() for \"name from GeneratedValue\"?\n","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/model/internal/IdGeneratorResolverSecondPass.java#L104-L140","documentation":"Error \"@GeneratedValue for %s (%s) specified SEQUENCE generation, but referred to a @GenericGenerator\" thrown in hibernate/hibernate-orm.","triggerScenarios":"An identifier/value generator declaration is inconsistent with the referenced generator or the annotated element.","commonSituations":"@GeneratedValue pointing at a generator of the wrong kind (SEQUENCE vs TABLE), a missing named generator, too many generator annotations, or an unsupported generation strategy for @CollectionId.","solutions":["Reference a @SequenceGenerator for SEQUENCE generation instead of a @GenericGenerator."],"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"}