{"record":{"id":"a54ba2035f738a32","repo":"hibernate/hibernate-orm","slug":"unrecognized-field-unit-a54ba2","errorCode":null,"errorMessage":"Unrecognized field: ${unit}","messagePattern":"Unrecognized field: (.+?)","errorType":"exception","errorClass":"SemanticException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/dialect/OracleDialect.java","lineNumber":776,"sourceCode":"\t\t\t\t\telse {\n\t\t\t\t\t\tpattern.append( \"(\" );\n\t\t\t\t\t\textractField( pattern, DAY, unit );\n\t\t\t\t\t\tpattern.append( \"+\" );\n\t\t\t\t\t\textractField( pattern, HOUR, unit );\n\t\t\t\t\t\tpattern.append( \"+\" );\n\t\t\t\t\t\textractField( pattern, MINUTE, unit );\n\t\t\t\t\t\tpattern.append( \"+\" );\n\t\t\t\t\t\textractField( pattern, SECOND, unit );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tpattern.append( \"((?3-?2)\" );\n\t\t\t\t\tpattern.append( TemporalUnit.DAY.conversionFactor( unit, this ) );\n\t\t\t\t}\n\t\t\t\tpattern.append( \")\" );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new SemanticException( \"Unrecognized field: \" + unit );\n\t\t}\n\t\treturn pattern.toString();\n\t}\n\n\tprivate void extractField(StringBuilder pattern, TemporalUnit unit, TemporalUnit toUnit) {\n\t\tpattern.append( \"extract(\" );\n\t\tpattern.append( translateExtractField( unit ) );\n\t\tpattern.append( \" from (?3-?2)\" );\n\t\tswitch ( unit ) {\n\t\t\tcase YEAR:\n\t\t\tcase MONTH:\n\t\t\t\tpattern.append( \" year(9) to month\" );\n\t\t\t\tbreak;\n\t\t\tcase DAY:\n\t\t\tcase HOUR:\n\t\t\tcase MINUTE:\n\t\t\tcase SECOND:\n\t\t\t\tbreak;","sourceCodeStart":758,"sourceCodeEnd":794,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/dialect/OracleDialect.java#L758-L794","documentation":"Error \"Unrecognized field: ${unit}\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Triggered when the application calls a Hibernate dialect feature that the configured database dialect cannot provide: Unrecognized field: $the given unit.","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: Unrecognized field: $the given unit.","solutions":["Use a recognized temporal field name.","Verify the unit passed to the function."],"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"}