{"record":{"id":"02c47608d076cc4e","repo":"hibernate/hibernate-orm","slug":"setting-hibernate-temporal-changeset-id-supplier","errorCode":null,"errorMessage":"Setting 'hibernate.temporal.changeset_id_supplier' must specify a 'org.hibernate.temporal.spi.ChangesetIdentifierSupplier' implementation","messagePattern":"Setting 'hibernate\\.temporal\\.changeset_id_supplier' must specify a 'org\\.hibernate\\.temporal\\.spi\\.ChangesetIdentifierSupplier' implementation","errorType":"exception","errorClass":"HibernateException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/temporal/internal/ChangesetCoordinatorImpl.java","lineNumber":124,"sourceCode":"\t\t\t// session across calls to the database\n\t\t\t&& dialect.isCurrentTimestampStable();\n\t}\n\n\tprivate ChangesetIdentifierSupplier<?> resolveSupplier(\n\t\t\tMap<String,Object> settings,\n\t\t\tStrategySelector strategySelector) {\n\t\tfinal Object setting = settings.get( CHANGESET_ID_SUPPLIER );\n\t\tif ( setting == null ) {\n\t\t\treturn this;\n\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) {","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/temporal/internal/ChangesetCoordinatorImpl.java#L106-L142","documentation":"hibernate.temporal.changeset_id_supplier accepts an instance, a Class, or a class-name String. When the value is a Class that is not assignable to org.hibernate.temporal.spi.ChangesetIdentifierSupplier, strategy resolution is refused with this HibernateException — a temporal supplier must implement that SPI interface, and Hibernate will not coerce or adapt other generator types.","triggerScenarios":"Putting a Class object under the setting that implements some other generator interface (a generic IdentifierGenerator, a supplier for a different feature) or a class that lost its implements clause during refactoring: the ChangesetIdentifierSupplier.class.isAssignableFrom(clazz) check fails and the exception is thrown.","commonSituations":"Adapting an existing id-generator class to temporal versioning without implementing the SPI; refactoring the supplier into a new class that no longer implements the interface; passing the class of a supplier compiled against an incompatible version.","solutions":["Make the configured class implement org.hibernate.temporal.spi.ChangesetIdentifierSupplier, with a public no-arg constructor so strategy resolution can build it.","Alternatively pass an already-constructed instance or the fully-qualified class-name string of a correct implementation."],"exampleFix":"// before\npublic class UuidChangesetIdSupplier { ... } // does not implement the SPI\n\n// after\npublic class UuidChangesetIdSupplier\n        implements org.hibernate.temporal.spi.ChangesetIdentifierSupplier<UUID> {\n    public UuidChangesetIdSupplier() {}\n    ...\n}","handlingStrategy":"type-guard","validationCode":"Object v = settings.get(\"hibernate.temporal.changeset_id_supplier\");\nif (v instanceof Class<?> clazz\n        && !org.hibernate.temporal.spi.ChangesetIdentifierSupplier.class.isAssignableFrom(clazz)) {\n    throw new IllegalStateException(clazz + \" does not implement ChangesetIdentifierSupplier\");\n}","typeGuard":"static boolean isChangesetSupplier(Class<?> clazz) {\n    return org.hibernate.temporal.spi.ChangesetIdentifierSupplier.class.isAssignableFrom(clazz);\n}","tryCatchPattern":null,"preventionTips":["Compile custom suppliers against the exact Hibernate version in use so the SPI interface matches.","Assert isChangesetSupplier(...) in a startup check before SessionFactory creation.","Prefer passing a fully-qualified class-name string and let strategy selection build it."],"tags":["hibernate","temporal-versioning","strategy-selection","configuration","interface-mismatch"],"backgroundTag":"invalid-strategy-class","analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}