{"record":{"id":"f1729479432ee836","repo":"hibernate/hibernate-orm","slug":"no-create-schema-syntax-supported-by-getclass-f17294","errorCode":null,"errorMessage":"No create schema syntax supported by \" + getClass().getName()","messagePattern":"No create schema syntax supported by \" \\+ getClass\\(\\)\\.getName\\(\\)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/FirebirdDialect.java","lineNumber":590,"sourceCode":"\t\t\t\t\t\"VAR_SAMP\" );\n\t\t}\n\t\telse {\n\t\t\tbuilder.applyReservedWords(\n\t\t\t\t\t\"AVG\", \"CHARACTER_LENGTH\", \"CHAR_LENGTH\", \"COUNT\", \"EXTRACT\", \"LOWER\", \"MAX\", \"MIN\", \"OCTET_LENGTH\",\n\t\t\t\t\t\"POSITION\", \"SUM\", \"TRIM\", \"UPPER\" );\n\t\t}\n\n\t\treturn super.buildIdentifierHelper( builder, metadata );\n\t}\n\n\t@Override\n\tpublic boolean canCreateSchema() {\n\t\treturn false;\n\t}\n\n\t@Override\n\tpublic String[] getCreateSchemaCommand(String schemaName) {\n\t\tthrow new UnsupportedOperationException( \"No create schema syntax supported by \" + getClass().getName() );\n\t}\n\n\t@Override\n\tpublic String[] getDropSchemaCommand(String schemaName) {\n\t\tthrow new UnsupportedOperationException( \"No drop schema syntax supported by \" + getClass().getName() );\n\t}\n\n\t@Override\n\tpublic boolean qualifyIndexName() {\n\t\treturn false;\n\n\t}\n\n\t@Override\n\tpublic boolean supportsCommentOn() {\n\t\treturn getVersion().isSameOrAfter( 2, 0 );\n\t}\n","sourceCodeStart":572,"sourceCodeEnd":608,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/FirebirdDialect.java#L572-L608","documentation":"FirebirdDialect.canCreateSchema() returns false and its getCreateSchemaCommand hook throws UnsupportedOperationException, because Firebird has no CREATE SCHEMA syntax (schemas are tied to database users). Hibernate's schema export calls this hook when it is asked to create namespaces before creating tables, so the exception surfaces from hbm2ddl/schema migration tooling, not from normal query execution.","triggerScenarios":"Running schema export with namespace creation enabled: 'hibernate.hbm2ddl.create_namespaces=true' plus hbm2ddl.auto=create/create-drop, SchemaExport.create(true, false), or Hibernate reactive/schema scripts generation with create-schemas enabled, while mappings or the connection URL specify a schema for Firebird.","commonSituations":"Copying persistence-unit configuration from a PostgreSQL/Oracle project (where create_namespaces is common) to a Firebird one; specifying default-schema in mappings and letting hbm2ddl try to provision it; CI bootstrap scripts that generate the DDL for multiple databases.","solutions":["Remove 'hibernate.hbm2ddl.create_namespaces' (or set it to false) so schema export never asks the dialect for CREATE SCHEMA","Drop the schema/defaultSchema attribute from mappings and the connection URL for the Firebird persistence unit","Provision Firebird objects manually: create the database/user that owns the objects, or manage DDL with Flyway/Liquibase scripts that contain only Firebird-valid statements","If you generate scripts, filter generated CREATE SCHEMA lines out of the Firebird target script"],"exampleFix":"// before (persistence.xml, throws during schema export on Firebird)\n<property name=\"hibernate.hbm2ddl.auto\" value=\"create\"/>\n<property name=\"hibernate.hbm2ddl.create_namespaces\" value=\"true\"/>\n<property name=\"hibernate.default_schema\" value=\"APP\"/>\n\n// after (no namespace creation, no schema qualifier)\n<property name=\"hibernate.hbm2ddl.auto\" value=\"create\"/>","handlingStrategy":"validation","validationCode":"// gate namespace creation on the dialect capability before schema export\nDialect d = sessionFactory.getJdbcServices().getDialect();\nif (d.canCreateSchema()) {\n    new SchemaExport().create(EnumSet.of(TargetType.DATABASE), metadata); // with namespaces\n} else {\n    // skip namespace creation; assume objects exist\n}","typeGuard":"static boolean schemaCreationSafe(Dialect d) {\n    return d.canCreateSchema(); // false for Firebird\n}","tryCatchPattern":"try {\n    new SchemaExport().createOnly(script, export, metadata);\n} catch (UnsupportedOperationException e) {\n    if (e.getMessage().contains(\"create schema\")) {\n        log.warn(\"Firebird cannot create schemas; ensure the database/user exists\");\n    } else throw e;\n}","preventionTips":["Leave 'hibernate.hbm2ddl.create_namespaces' unset (default false) unless a dialect supports it","Do not set default_schema on the Firebird persistence unit","Provision Firebird databases with DB-native scripts (isql/Flyway), not Hibernate namespace tooling"],"tags":["hibernate","firebird","hbm2ddl","schema-export","ddl","create-schema"],"backgroundTag":"schema-management-unsupported","analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}