{"record":{"id":"ef6a020367d37273","repo":"hibernate/hibernate-orm","slug":"no-drop-schema-syntax-supported-by-getclass-ef6a02","errorCode":null,"errorMessage":"No drop schema syntax supported by \" + getClass().getName()","messagePattern":"No drop 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":595,"sourceCode":"\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\n\t@Override\n\tpublic boolean supportsLobValueChangePropagation() {\n\t\t// May need changes in Jaybird for this to work\n\t\treturn false;\n\t}","sourceCodeStart":577,"sourceCodeEnd":613,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/FirebirdDialect.java#L577-L613","documentation":"FirebirdDialect.getDropSchemaCommand throws UnsupportedOperationException (and canCreateSchema() returns false) because Firebird has no DROP SCHEMA statement - schemas map to database users and cannot be dropped as objects. The exception comes from Hibernate's schema dropper/migration tooling when it tries to dispose of a namespace.","triggerScenarios":"Running hbm2ddl drop/drop-and-create with 'hibernate.hbm2ddl.create_namespaces=true', SchemaExport.drop(true, ...), or any tooling that asks the dialect for DROP SCHEMA on Firebird - typically because default-schema is set in mappings or the URL.","commonSituations":"drop-and-create test teardown copied from another database's configuration; Flyway/Liquibase-managed projects that additionally run Hibernate schema cleanup; multi-database products where the Firebird persistence unit inherited schema lifecycle settings.","solutions":["Set 'hibernate.hbm2ddl.create_namespaces' to false (or remove it) so the dropper never requests DROP SCHEMA","Remove schema qualifiers (default_schema / @Table(schema=...)) from the Firebird mappings","Do schema lifecycle manually in Firebird-aware scripts (drop/recreate the database file or objects), not through Hibernate tooling","Prefer 'create' or validated schema modes for Firebird test databases instead of drop-and-create with namespaces"],"exampleFix":"// before (throws during drop phase on Firebird)\nMap<String, Object> props = new HashMap<>();\nprops.put(AvailableSettings.HBM2DDL_AUTO, \"drop-and-create\");\nprops.put(AvailableSettings.HBM2DDL_CREATE_NAMESPACES, true);\n\n// after (no namespace lifecycle through Hibernate)\nprops.put(AvailableSettings.HBM2DDL_AUTO, \"drop-and-create\");","handlingStrategy":"validation","validationCode":"Dialect d = sessionFactory.getJdbcServices().getDialect();\nif (!d.canCreateSchema()) {\n    // configure dropper without namespace handling\n    props.remove(AvailableSettings.HBM2DDL_CREATE_NAMESPACES);\n}","typeGuard":"static boolean schemaDropSafe(Dialect d) {\n    return d.canCreateSchema(); // FirebirdDialect returns false and throws on drop\n}","tryCatchPattern":"try {\n    new SchemaExport().drop(TargetType.DATABASE, metadata);\n} catch (UnsupportedOperationException e) {\n    if (e.getMessage().contains(\"drop schema\")) {\n        // drop objects only (tables/sequences) and skip namespaces\n    } else throw e;\n}","preventionTips":["Use 'create' or 'none' instead of drop-and-create for Firebird test databases","Keep schema lifecycle out of Hibernate for Firebird; script it with the DB's own tools","Assert canCreateSchema() in a configuration self-check when multiple persistence units share settings"],"tags":["hibernate","firebird","hbm2ddl","schema-export","ddl","drop-schema"],"backgroundTag":"schema-management-unsupported","analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}