{"record":{"id":"8ee8565a40ebbf90","repo":"hibernate/hibernate-orm","slug":"got-different-size-of-tuples-and-aliases","errorCode":null,"errorMessage":"Got different size of tuples and aliases","messagePattern":"Got different size of tuples and aliases","errorType":"exception","errorClass":"HibernateException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/jpa/spi/NativeQueryTupleTransformer.java","lineNumber":79,"sourceCode":"\n\tprivate static class NativeTupleImpl implements Tuple {\n\n\t\tprivate final Object[] tuple;\n\n\t\tprivate final int size;\n\n\t\tprivate final Map<String, Object> aliasToValue = new LinkedHashMap<>();\n\t\tprivate final Map<String, String> aliasReferences = new LinkedHashMap<>();\n\n\t\tpublic NativeTupleImpl(Object[] tuple, String[] aliases) {\n\t\t\tif ( tuple == null ) {\n\t\t\t\tthrow new HibernateException( \"Tuple must not be null\" );\n\t\t\t}\n\t\t\tif ( aliases == null ) {\n\t\t\t\tthrow new HibernateException( \"Aliases must not be null\" );\n\t\t\t}\n\t\t\tif ( tuple.length != aliases.length ) {\n\t\t\t\tthrow new HibernateException( \"Got different size of tuples and aliases\" );\n\t\t\t}\n\t\t\tthis.tuple = tuple;\n\t\t\tfor ( int i = 0; i < tuple.length; i++ ) {\n\t\t\t\tfinal String alias = aliases[i];\n\t\t\t\tif ( alias != null ) {\n\t\t\t\t\taliasToValue.put( alias, tuple[i] );\n\t\t\t\t\taliasReferences.put( alias.toLowerCase(ROOT), alias );\n\t\t\t\t}\n\t\t\t}\n\t\t\tsize = tuple.length;\n\t\t}\n\n\t\t@Override\n\t\tpublic <X> X get(String alias, Class<X> type) {\n\t\t\tfinal Object untyped = get( alias );\n\n\t\t\treturn ( untyped != null ) ? type.cast( untyped ) : null;\n\t\t}","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/jpa/spi/NativeQueryTupleTransformer.java#L61-L97","documentation":"Error \"Got different size of tuples and aliases\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Thrown at hibernate-core/src/main/java/org/hibernate/jpa/spi/NativeQueryTupleTransformer.java:79 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the number of declared aliases/scalars matches the columns returned by the native query."],"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"}