{"record":{"id":"6dcc56272a3839f7","repo":"hibernate/hibernate-orm","slug":"style-s-should-not-be-specified-with-custom-uui","errorCode":null,"errorMessage":"Style [%s] should not be specified with custom UUID value generator: %s.%s","messagePattern":"Style \\[(.+?)\\] should not be specified with custom UUID value generator: (.+?)\\.(.+?)","errorType":"exception","errorClass":"MappingException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/id/uuid/UuidGenerator.java","lineNumber":123,"sourceCode":"\t@Internal\n\tpublic ValueTransformer getValueTransformer() {\n\t\treturn valueTransformer;\n\t}\n\n\tprivate static UuidValueGenerator determineValueGenerator(\n\t\t\torg.hibernate.annotations.UuidGenerator config,\n\t\t\tString memberDeclaringClassName,\n\t\t\tString memberName) {\n\t\tif ( config == null ) {\n\t\t\treturn StandardRandomStrategy.INSTANCE;\n\t\t}\n\t\telse {\n\t\t\t// there is an annotation\n\t\t\tfinal var style = config.style();\n\t\t\tif ( config.algorithm() != UuidValueGenerator.class ) {\n\t\t\t\t// the annotation specified a custom algorithm\n\t\t\t\tif ( style != AUTO ) {\n\t\t\t\t\tthrow new MappingException(\n\t\t\t\t\t\t\tString.format(\n\t\t\t\t\t\t\t\t\tLocale.ROOT,\n\t\t\t\t\t\t\t\t\t\"Style [%s] should not be specified with custom UUID value generator: %s.%s\",\n\t\t\t\t\t\t\t\t\tstyle.name(),\n\t\t\t\t\t\t\t\t\tmemberDeclaringClassName,\n\t\t\t\t\t\t\t\t\tmemberName\n\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn instantiateCustomGenerator( config.algorithm() );\n\t\t\t}\n\t\t\treturn switch ( style ) {\n\t\t\t\tcase TIME -> new CustomVersionOneStrategy();\n\t\t\t\tcase VERSION_6 -> UuidVersion6Strategy.INSTANCE;\n\t\t\t\tcase VERSION_7 -> UuidVersion7Strategy.INSTANCE;\n\t\t\t\tdefault -> StandardRandomStrategy.INSTANCE;\n\t\t\t};\n\t\t}","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/id/uuid/UuidGenerator.java#L105-L141","documentation":"Error \"Style [%s] should not be specified with custom UUID value generator: %s.%s\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Thrown when a custom UUID value generator is combined with an incompatible style setting.","commonSituations":"Typical situations: specifying a style together with a custom UUID generator; conflicting @UuidGenerator attributes.","solutions":["Remove the 'style' parameter from the UUID generator configuration when a custom value generator class is used."],"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"}