{"record":{"id":"21ee6c0096bece7f","repo":"hibernate/hibernate-orm","slug":"unsupported-temporal-amount-type-literal","errorCode":null,"errorMessage":"Unsupported temporal amount type: ${literal}","messagePattern":"Unsupported temporal amount type: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java","lineNumber":6378,"sourceCode":"\t\t\t\t\tappender.appendSql( \"' \" );\n\t\t\t\t\tif ( unit == ChronoUnit.YEARS ) {\n\t\t\t\t\t\tappender.appendSql( \"year\" );\n\t\t\t\t\t}\n\t\t\t\t\telse if ( unit == ChronoUnit.MONTHS ) {\n\t\t\t\t\t\tappender.appendSql( \"month\" );\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tassert unit == ChronoUnit.DAYS;\n\t\t\t\t\t\tappender.appendSql( \"day\" );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( parenthesis ) {\n\t\t\t\tappender.appendSql( ')' );\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new IllegalArgumentException( \"Unsupported temporal amount type: \" + literal );\n\t\t}\n\t}\n\n\t/**\n\t * Append a literal SQL {@code uuid} representing the given Java\n\t * {@link UUID}.\n\t * <p>\n\t * This is usually a {@code cast()} expression, but it might be\n\t * a function call.\n\t */\n\tpublic void appendUUIDLiteral(SqlAppender appender, UUID literal) {\n\t\tappender.appendSql( \"cast('\" );\n\t\tappender.appendSql( literal.toString() );\n\t\tappender.appendSql( \"' as uuid)\" );\n\t}\n\n\t/**\n\t * Does this dialect support timezone offsets in temporal literals?","sourceCodeStart":6360,"sourceCodeEnd":6396,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java#L6360-L6396","documentation":"Dialect#appendLiteral for temporal literals only knows java.time.Duration and java.time.Period. Any other TemporalAmount implementation passed as a literal reaches the else-throw. The at-fault input is a custom or non-standard TemporalAmount that neither branch can render.","triggerScenarios":"Triggered when the application calls a Hibernate dialect feature that the configured database dialect cannot provide: Unsupported temporal amount type: the given literal.","commonSituations":"Common when running against a database whose dialect lacks this capability, when a mapping or HQL/Criteria query requests unsupported functionality, or when the wrong dialect is configured for the database in use. Error: Unsupported temporal amount type: the given literal.","solutions":["Use Duration or Period for temporal amounts.","Convert the value to a supported temporal amount type."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}