{"record":{"id":"ef7fb104cdf69270","repo":"hibernate/hibernate-orm","slug":"cannot-treat-updatecountoutput-as-resultsetoutput","errorCode":null,"errorMessage":"Cannot treat UpdateCountOutput as ResultSetOutput","messagePattern":"Cannot treat UpdateCountOutput as ResultSetOutput","errorType":"exception","errorClass":"IllegalOutputTypeException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/procedure/UpdateCountOutput.java","lineNumber":23,"sourceCode":"package org.hibernate.procedure;\n\nimport jakarta.persistence.sql.ResultSetMapping;\n\n/// Models a return that is an update count (count of rows affected)\n///\n/// @author Steve Ebersole\npublic interface UpdateCountOutput extends Output {\n\t/// Retrieve the associated update count\n\tint getUpdateCount();\n\n\t@Override\n\tdefault UpdateCountOutput asUpdateCountOutput() {\n\t\treturn this;\n\t}\n\n\t@Override\n\tdefault ResultSetOutput<?> asResultSetOutput() {\n\t\tthrow new  IllegalOutputTypeException( \"Cannot treat UpdateCountOutput as ResultSetOutput\" );\n\t}\n\n\t@Override\n\tdefault <X> ResultSetOutput<X> asResultSetOutput(Class<X> resultType) {\n\t\tthrow new  IllegalOutputTypeException( \"Cannot treat UpdateCountOutput as ResultSetOutput\" );\n\t}\n\n\t@Override\n\tdefault <X> ResultSetOutput<X> asResultSetOutput(ResultSetMapping<X> resultSetMapping) {\n\t\tthrow new  IllegalOutputTypeException( \"Cannot treat UpdateCountOutput as ResultSetOutput\" );\n\t}\n}\n","sourceCodeStart":5,"sourceCodeEnd":36,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/procedure/UpdateCountOutput.java#L5-L36","documentation":"Error \"Cannot treat UpdateCountOutput as ResultSetOutput\" thrown in hibernate/hibernate-orm.","triggerScenarios":"An API operation is invoked on an object that does not support it.","commonSituations":"Using query/procedure/proxy APIs beyond their supported feature set (e.g. scrolling, locking, unwrapping a procedure call).","solutions":["Check the output type before casting: use outputs.getCurrent() instanceof ResultSetOutput.","Advance through outputs with goToNext() until a result-set output is current."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}