{"record":{"id":"0783684821e790b3","repo":"hibernate/hibernate-orm","slug":"nationalized-character-data-not-supported-on-this","errorCode":null,"errorMessage":"Nationalized character data not supported on this database","messagePattern":"Nationalized character data not supported on this database","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/dialect/NationalizationSupport.java","lineNumber":44,"sourceCode":"\n\t/**\n\t * The database does define and support distinct SQL types\n\t * for representing nationalized character data, typically\n\t * named {@code NCHAR}, {@code NVARCHAR}, and {@code NCLOB}.\n\t */\n\tEXPLICIT,\n\n\t/**\n\t * The database does not even have support for nationalized\n\t * character data.\n\t */\n\tUNSUPPORTED;\n\n\tpublic int getCharVariantCode() {\n\t\treturn switch ( this ) {\n\t\t\tcase IMPLICIT -> Types.CHAR;\n\t\t\tcase EXPLICIT -> Types.NCHAR;\n\t\t\tcase UNSUPPORTED -> throw new UnsupportedOperationException(\"Nationalized character data not supported on this database\");\n\t\t};\n\t}\n\n\tpublic int getVarcharVariantCode() {\n\t\treturn switch ( this ) {\n\t\t\tcase IMPLICIT -> Types.VARCHAR;\n\t\t\tcase EXPLICIT -> Types.NVARCHAR;\n\t\t\tcase UNSUPPORTED -> throw new UnsupportedOperationException(\"Nationalized character data not supported on this database\");\n\t\t};\n\t}\n\n\tpublic int getLongVarcharVariantCode() {\n\t\treturn switch ( this ) {\n\t\t\tcase IMPLICIT -> Types.LONGVARCHAR;\n\t\t\tcase EXPLICIT -> Types.LONGNVARCHAR;\n\t\t\tcase UNSUPPORTED -> throw new UnsupportedOperationException(\"Nationalized character data not supported on this database\");\n\t\t};\n\t}","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/dialect/NationalizationSupport.java#L26-L62","documentation":"NationalizationSupport.UNSUPPORTED.getCharVariantCode throws: the current dialect declared no nationalized character support at all, so there is no NCHAR-equivalent JDBC type code to return. It fires whenever code asks for the nationalized char/varchar/clob code on a dialect whose support level is UNSUPPORTED.","triggerScenarios":"Triggered when the application calls a Hibernate dialect feature that the configured database dialect cannot provide: Nationalized character data not supported on this database.","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: Nationalized character data not supported on this database.","solutions":["Remove @Nationalized from the mapping.","Use a database that supports national character types."],"exampleFix":null,"handlingStrategy":"fallback","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"}