hibernate/hibernate-orm · error · IllegalArgumentException
Exporter does not support name array types. Can't generate d
Error message
Exporter does not support name array types. Can't generate drop strings for:
What it means
StandardUserDefinedTypeExporter cannot generate DROP statements for named array types: getSqlDropStrings(UserDefinedArrayType) unconditionally throws this IllegalArgumentException. During schema drop with the standard exporter, any UserDefinedArrayType in the Metadata aborts the operation.
Source
Thrown at hibernate-core/src/main/java/org/hibernate/tool/schema/internal/StandardUserDefinedTypeExporter.java:153
public String[] getSqlDropStrings(UserDefinedObjectType userDefinedType, Metadata metadata, SqlStringGenerationContext context) {
final var dropType = new StringBuilder( "drop type " );
if ( dialect.supportsIfExistsBeforeTypeName() ) {
dropType.append( "if exists " );
}
final var typeName = new QualifiedNameParser.NameParts(
Identifier.toIdentifier( userDefinedType.getCatalog(), userDefinedType.isCatalogQuoted() ),
Identifier.toIdentifier( userDefinedType.getSchema(), userDefinedType.isSchemaQuoted() ),
userDefinedType.getNameIdentifier()
);
dropType.append( context.format( typeName ) );
if ( dialect.supportsIfExistsAfterTypeName() ) {
dropType.append( " if exists" );
}
return new String[] { dropType.toString() };
}
public String[] getSqlDropStrings(UserDefinedArrayType userDefinedType, Metadata metadata, SqlStringGenerationContext context) {
throw new IllegalArgumentException( "Exporter does not support name array types. Can't generate drop strings for: " + userDefinedType );
}
}
View on GitHub (pinned to fad1729dce)
Solutions
- Use a dialect with array-UDT support whose exporter renders the array drop statement.
- Remove the named-array mapping (plain ARRAY mapping) so no UserDefinedArrayType reaches the exporter.
- Drop the array type via an external migration script and disable hbm2ddl drop for it.
Example fix
// before @Array(length = 10) @JdbcTypeCode(SqlTypes.ARRAY) private List<String> tags; // registers a named array UDT; drop export throws // after @JdbcTypeCode(SqlTypes.ARRAY) private List<String> tags; // no named UDT; drop path skips the array exporter
Defensive patterns
Strategy: type-guard
Validate before calling
for (UserDefinedType udt : udtsInMetadata) {
if (udt instanceof UserDefinedArrayType && exporterIsStandard(dialect)) {
skipOrFailFast("array UDT " + udt + " cannot be dropped by the standard exporter");
}
} Type guard
static boolean needsDialectArrayExporter(UserDefinedType udt, Dialect dialect) {
return udt instanceof UserDefinedArrayType
&& dialect.getUserDefinedTypeExporter().getClass() == StandardUserDefinedTypeExporter.class;
} Try / catch
try {
exporter.getSqlDropStrings(userDefinedArrayType, metadata, context);
} catch (IllegalArgumentException e) {
if (e.getMessage() != null && e.getMessage().contains("array types")) {
// use an array-capable dialect, drop the named-array mapping, or drop the type via migration script
} else { throw e; }
} Prevention
- Avoid named array UDT mappings unless the dialect ships array DDL support.
- Manage exotic type drops in migration scripts rather than hbm2ddl.
- Cover drop generation in dialect integration tests, not just create.
When it happens
Trigger: Running drop/create-drop with the default (standard) UDT exporter while the Metadata contains a named array type (UserDefinedArrayType, e.g., @Array-based mappings registered as UDTs) and no dialect-specific exporter handles array drops.
Common situations: Test teardown with create-drop on mappings containing array UDTs; switching dialects away from one with array support while keeping array type mappings; drop-script generation tooling iterating all UDTs in metadata.
Related errors
- Exporter does not support name array types. Can't generate c
- Error creating SQL create commands for UDT :
- No drop schema syntax supported by " + getClass().getName()
- No drop foreign key syntax supported by SQLiteDialect
- No add foreign key syntax supported by SQLiteDialect
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/b95f84a02796b72b.
Report an issue: GitHub.