hibernate/hibernate-orm · error · UnsupportedOperationException

No create schema syntax supported by " + getClass().getName(

Error message

No create schema syntax supported by " + getClass().getName()

What it means

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.

Source

Thrown at hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/FirebirdDialect.java:590

					"VAR_SAMP" );
		}
		else {
			builder.applyReservedWords(
					"AVG", "CHARACTER_LENGTH", "CHAR_LENGTH", "COUNT", "EXTRACT", "LOWER", "MAX", "MIN", "OCTET_LENGTH",
					"POSITION", "SUM", "TRIM", "UPPER" );
		}

		return super.buildIdentifierHelper( builder, metadata );
	}

	@Override
	public boolean canCreateSchema() {
		return false;
	}

	@Override
	public String[] getCreateSchemaCommand(String schemaName) {
		throw new UnsupportedOperationException( "No create schema syntax supported by " + getClass().getName() );
	}

	@Override
	public String[] getDropSchemaCommand(String schemaName) {
		throw new UnsupportedOperationException( "No drop schema syntax supported by " + getClass().getName() );
	}

	@Override
	public boolean qualifyIndexName() {
		return false;

	}

	@Override
	public boolean supportsCommentOn() {
		return getVersion().isSameOrAfter( 2, 0 );
	}

View on GitHub (pinned to fad1729dce)

Solutions

  1. Remove 'hibernate.hbm2ddl.create_namespaces' (or set it to false) so schema export never asks the dialect for CREATE SCHEMA
  2. Drop the schema/defaultSchema attribute from mappings and the connection URL for the Firebird persistence unit
  3. 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
  4. If you generate scripts, filter generated CREATE SCHEMA lines out of the Firebird target script

Example fix

// before (persistence.xml, throws during schema export on Firebird)
<property name="hibernate.hbm2ddl.auto" value="create"/>
<property name="hibernate.hbm2ddl.create_namespaces" value="true"/>
<property name="hibernate.default_schema" value="APP"/>

// after (no namespace creation, no schema qualifier)
<property name="hibernate.hbm2ddl.auto" value="create"/>
Defensive patterns

Strategy: validation

Validate before calling

// gate namespace creation on the dialect capability before schema export
Dialect d = sessionFactory.getJdbcServices().getDialect();
if (d.canCreateSchema()) {
    new SchemaExport().create(EnumSet.of(TargetType.DATABASE), metadata); // with namespaces
} else {
    // skip namespace creation; assume objects exist
}

Type guard

static boolean schemaCreationSafe(Dialect d) {
    return d.canCreateSchema(); // false for Firebird
}

Try / catch

try {
    new SchemaExport().createOnly(script, export, metadata);
} catch (UnsupportedOperationException e) {
    if (e.getMessage().contains("create schema")) {
        log.warn("Firebird cannot create schemas; ensure the database/user exists");
    } else throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22). Data as JSON: /api/errors/f1729479432ee836. Report an issue: GitHub.