{"record":{"id":"3689d466066e188e","repo":"hibernate/hibernate-orm","slug":"generatedvalue-for-s-s-specified-table-genera-3689d4","errorCode":null,"errorMessage":"@GeneratedValue for %s (%s) specified TABLE generation, but referred to a @GenericGenerator","messagePattern":"@GeneratedValue for (.+?) \\((.+?)\\) specified TABLE 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":204,"sourceCode":"\n\t\tfinal var globalRegistrations = buildingContext.getMetadataCollector().getGlobalRegistrations();\n\t\tfinal String generator = generatedValue.generator();\n\n\t\tfinal var globalSequenceMatch = globalRegistrations.getSequenceGeneratorRegistrations().get( generator );\n\t\tif ( globalSequenceMatch != 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 TABLE generation, but referred to a @SequenceGenerator\",\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 TABLE 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// AUTO\n\n\tprivate boolean handleAsUuid(ClassDetailsRegistry classDetailsRegistry) {\n\t\tfinal var idMemberType = idMember.getType();\n\t\tif ( idMemberType.isImplementor( UUID.class ) || idMemberType.isImplementor( String.class ) ) {\n\t\t\tGeneratorAnnotationHelper.handleUuidStrategy(","sourceCodeStart":186,"sourceCodeEnd":222,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/model/internal/IdGeneratorResolverSecondPass.java#L186-L222","documentation":"Error \"@GeneratedValue for %s (%s) specified TABLE 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 @TableGenerator for TABLE 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"}