{"record":{"id":"fd2074dd0860ca85","repo":"hibernate/hibernate-orm","slug":"no-drop-schema-syntax-supported-by-getclass","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/AltibaseDialect.java","lineNumber":570,"sourceCode":"\n\t@Override\n\tpublic boolean canCreateSchema() {\n\t\treturn false;\n\t}\n\n\t@Override\n\tpublic NameQualifierSupport getNameQualifierSupport() {\n\t\treturn NameQualifierSupport.SCHEMA;\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\t}\n\n\t@Override\n\tpublic boolean supportsTruncateWithCast(){\n\t\treturn false;\n\t}\n\n\t@Override\n\tpublic boolean supportsCommentOn() {\n\t\treturn true;\n\t}\n\n\t@Override","sourceCodeStart":552,"sourceCodeEnd":588,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/AltibaseDialect.java#L552-L588","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Rename one of the CteObjects so names are unique within the statement.","Register the object once at a shared/outer statement level instead of once per sub-part.","Guard with getCteObject(name) before adding and reuse the existing object.","If no custom code registers CteObjects, report an HHH issue naming the dialect and query shape."],"exampleFix":"// before: adding two same-named objects\nstatement.addCteObject( new MyCteObject( \"obj\" ) );\nstatement.addCteObject( otherTranslator.getObj( \"obj\" ) ); // IllegalArgumentException\n\n// after: check and reuse\nif ( statement.getCteObject( \"obj\" ) == null ) {\n    statement.addCteObject( new MyCteObject( \"obj\" ) );\n}","handlingStrategy":"validation","validationCode":"// If you register WITH-clause objects programmatically: check first\nif ( statement.getCteObject( cteObject.getName() ) == null ) {\n    statement.addCteObject( cteObject );\n} else {\n    // reuse the existing object instead of re-adding\n}","typeGuard":null,"tryCatchPattern":"try {\n    statement.addCteObject( obj );\n} catch ( IllegalArgumentException e ) {\n    if ( e.getMessage() != null && e.getMessage().startsWith(\"A CTE object with the name\") ) {\n        statement.addCteObject( rename( obj, uniqueName() ) );\n    } else {\n        throw e;\n    }\n}","preventionTips":["Register each named WITH-clause object exactly once per statement, at the outermost useful container.","Guard addCteObject with getCteObject(name) in any code that merges statements or subqueries.","Track CTE-object names alongside CTE labels when auditing generated queries."],"tags":["cte","duplicate","sql","query-construction"],"backgroundTag":"duplicate-cte-name","analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T14:17:55.899Z"}