hibernate/hibernate-orm · error · UnsupportedOperationException

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

Error message

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

What it means

Besides query CTEs, a WITH clause can hold named CteObjects (auxiliary named objects declared in the WITH clause, used by dialect-specific and structured-type features). They are stored in a map keyed by name, and addCteObject throws IllegalArgumentException when a second object with the same name is registered on one statement. Like the CTE-label duplicate, this guards the query-construction phase against name collisions.

Source

Thrown at hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/AltibaseDialect.java:570

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

	@Override
	public NameQualifierSupport getNameQualifierSupport() {
		return NameQualifierSupport.SCHEMA;
	}

	@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 supportsTruncateWithCast(){
		return false;
	}

	@Override
	public boolean supportsCommentOn() {
		return true;
	}

	@Override

View on GitHub (pinned to fad1729dce)

Solutions

  1. Rename one of the CteObjects so names are unique within the statement.
  2. Register the object once at a shared/outer statement level instead of once per sub-part.
  3. Guard with getCteObject(name) before adding and reuse the existing object.
  4. If no custom code registers CteObjects, report an HHH issue naming the dialect and query shape.

Example fix

// before: adding two same-named objects
statement.addCteObject( new MyCteObject( "obj" ) );
statement.addCteObject( otherTranslator.getObj( "obj" ) ); // IllegalArgumentException

// after: check and reuse
if ( statement.getCteObject( "obj" ) == null ) {
    statement.addCteObject( new MyCteObject( "obj" ) );
}
Defensive patterns

Strategy: validation

Validate before calling

// If you register WITH-clause objects programmatically: check first
if ( statement.getCteObject( cteObject.getName() ) == null ) {
    statement.addCteObject( cteObject );
} else {
    // reuse the existing object instead of re-adding
}

Try / catch

try {
    statement.addCteObject( obj );
} catch ( IllegalArgumentException e ) {
    if ( e.getMessage() != null && e.getMessage().startsWith("A CTE object with the name") ) {
        statement.addCteObject( rename( obj, uniqueName() ) );
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: Calling addCteObject twice with objects of the same getName() on one AbstractStatement - typically inside framework code, custom translators, or criteria/CTE extensions that materialize named WITH-clause objects; also two subquery statements being merged onto a shared container that both carry the same-named object.

Common situations: Dialect extensions or Hibernate versions that add typed/structured CTE objects (e.g. for array/struct features) colliding with user- or tool-generated ones; regression after upgrade changing where CTE objects get attached.

Related errors


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