{"record":{"id":"51fd2286fca6cb8d","repo":"hibernate/hibernate-orm","slug":"setting-hibernate-temporal-changeset-id-supplier-51fd22","errorCode":null,"errorMessage":"Setting 'hibernate.temporal.changeset_id_supplier' must specify a 'org.hibernate.temporal.spi.ChangesetIdentifierSupplier' instance, class, or class name","messagePattern":"Setting 'hibernate\\.temporal\\.changeset_id_supplier' must specify a 'org\\.hibernate\\.temporal\\.spi\\.ChangesetIdentifierSupplier' instance, class, or class name","errorType":"exception","errorClass":"HibernateException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/temporal/internal/ChangesetCoordinatorImpl.java","lineNumber":134,"sourceCode":"\t\t}\n\t\telse if ( setting instanceof ChangesetIdentifierSupplier<?> supplier ) {\n\t\t\treturn supplier;\n\t\t}\n\t\telse if ( setting instanceof Class<?> clazz ) {\n\t\t\tif ( ChangesetIdentifierSupplier.class.isAssignableFrom( clazz ) ) {\n\t\t\t\treturn strategySelector.resolveStrategy( ChangesetIdentifierSupplier.class, clazz );\n\t\t\t}\n\t\t\tthrow new HibernateException(\n\t\t\t\t\t\"Setting '\" + CHANGESET_ID_SUPPLIER + \"' must specify a '\"\n\t\t\t\t\t+ ChangesetIdentifierSupplier.class.getName()\n\t\t\t\t\t+ \"' implementation\"\n\t\t\t);\n\t\t}\n\t\telse if ( setting instanceof String name ) {\n\t\t\treturn strategySelector.resolveStrategy( ChangesetIdentifierSupplier.class, name );\n\t\t}\n\t\telse {\n\t\t\tthrow new HibernateException(\n\t\t\t\t\t\"Setting '\" + CHANGESET_ID_SUPPLIER + \"' must specify a '\"\n\t\t\t\t\t+ ChangesetIdentifierSupplier.class.getName()\n\t\t\t\t\t+ \"' instance, class, or class name\"\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate static Class<?> resolveSuppliedType(Class<? extends ChangesetIdentifierSupplier<?>> supplierClass) {\n\t\tfinal var supplierInstantiation = supertypeInstantiation( ChangesetIdentifierSupplier.class, supplierClass );\n\t\tif ( supplierInstantiation == null ) {\n\t\t\treturn null;\n\t\t}\n\t\telse {\n\t\t\tfinal var typeArguments = supplierInstantiation.getActualTypeArguments();\n\t\t\treturn typeArguments.length == 0 ? null : erasedType( typeArguments[0] );\n\t\t}\n\t}\n","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/temporal/internal/ChangesetCoordinatorImpl.java#L116-L152","documentation":"The changeset-id-supplier setting handles exactly three value shapes: a ChangesetIdentifierSupplier instance, a Class object, or a String class name. Any other runtime type falls through to the final else-branch and bootstrap fails with this HibernateException naming the accepted shapes.","triggerScenarios":"Supplying hibernate.temporal.changeset_id_supplier as a non-String, non-Class object: a number or boolean coerced from an XML/YAML property value, a List/Map from a deserialized config, or a java.net.URL/Path produced by system-property handling — none of the three instanceof branches match.","commonSituations":"persistence.xml <property value=\"...\"> parsed into a primitive by a config framework; YAML/JSON config deserialized into typed values; property placeholders resolved to unexpected types by an environment binder.","solutions":["Set the property to one of the accepted shapes: an instance of the supplier, its Class object, or its fully-qualified class name as a String.","Fix the source that coerced the value (XML persistence.xml, YAML map, env-var binder) so the setting reaches Hibernate as a String at minimum."],"exampleFix":"# before (YAML binder delivered an Integer)\nhibernate.temporal.changeset_id_supplier: 42\n\n# after\nhibernate.temporal.changeset_id_supplier: org.acme.UuidChangesetIdSupplier","handlingStrategy":"type-guard","validationCode":"Object v = settings.get(\"hibernate.temporal.changeset_id_supplier\");\nif (v != null && !(v instanceof String) && !(v instanceof Class)\n        && !(v instanceof org.hibernate.temporal.spi.ChangesetIdentifierSupplier)) {\n    throw new IllegalStateException(\"changeset_id_supplier must be instance, Class, or class name; got \" + v.getClass());\n}","typeGuard":"static boolean validSupplierSetting(Object v) {\n    return v == null\n            || v instanceof org.hibernate.temporal.spi.ChangesetIdentifierSupplier\n            || v instanceof Class\n            || v instanceof String;\n}","tryCatchPattern":null,"preventionTips":["Keep the setting as a String in XML/YAML so no binder coerces it to another type.","Test config loading with the same binder used in production.","Add a startup assertion validSupplierSetting(...) before SessionFactory creation."],"tags":["hibernate","temporal-versioning","configuration","type-mismatch"],"backgroundTag":"config-value-wrong-type","analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}