{"record":{"id":"b7c88f605d4227d1","repo":"hibernate/hibernate-orm","slug":"support-for-multiple-properties-not-implemented","errorCode":null,"errorMessage":"support for multiple properties not implemented","messagePattern":"support for multiple properties not implemented","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/persister/entity/EntityPersister.java","lineNumber":1341,"sourceCode":"\t *\n\t * @param propertyName The name of the property which maps to the\n\t *           column(s) to use in the select statement restriction.\n\t * @return The SQL select string\n\t */\n\tString getSelectByUniqueKeyString(String propertyName);\n\n\t/**\n\t * Get a SQL select string that performs a select based on a unique\n\t * key determined by the given property names.\n\t *\n\t * @param propertyNames The names of the properties which maps to the\n\t *               column(s) to use in the select statement restriction.\n\t * @return The SQL select string\n\t */\n\tdefault String getSelectByUniqueKeyString(String[] propertyNames) {\n\t\t// default impl only for backward compatibility\n\t\tif ( propertyNames.length > 1 ) {\n\t\t\tthrow new IllegalArgumentException( \"support for multiple properties not implemented\" );\n\t\t}\n\t\treturn getSelectByUniqueKeyString( propertyNames[0] );\n\t}\n\n\tString getSelectByUniqueKeyString(String[] propertyNames, String[] columnNames);\n\n\n\t/**\n\t * The names of the primary key columns in the root table.\n\t *\n\t * @return The primary key column names.\n\t */\n\tString[] getRootTableKeyColumnNames();\n\n\t/**\n\t * Get the database-specific SQL command to retrieve the last\n\t * generated IDENTITY value.\n\t *","sourceCodeStart":1323,"sourceCodeEnd":1359,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/persister/entity/EntityPersister.java#L1323-L1359","documentation":"The backward-compatible default EntityPersister.getSelectByUniqueKeyString(String[] propertyNames) accepts an array but explicitly supports only a single property: length > 1 throws IllegalArgumentException('support for multiple properties not implemented'). Composite (multi-column) unique keys must use the newer overload getSelectByUniqueKeyString(String[] propertyNames, String[] columnNames).","triggerScenarios":"Calling the legacy single-array overload with two or more property names — typically generic code that resolves all columns of a multi-column unique key and forwards the whole property set to the old entry point.","commonSituations":"Framework or custom-persister code written against the pre-array signature; migrating code that feeds complete unique-key column sets; retrofitting single-property helpers to composite keys.","solutions":["Switch to getSelectByUniqueKeyString(propertyNames, columnNames) when more than one property is involved","Pass only the single property name to the legacy overload","If you own the persister, implement the legacy method for multi-property keys instead of relying on the default"],"exampleFix":"// before\nif ( propertyNames.length > 1 ) {\n    sql = persister.getSelectByUniqueKeyString(propertyNames); // throws IllegalArgumentException\n}\n\n// after\nsql = persister.getSelectByUniqueKeyString(\n        propertyNames,\n        correspondingColumnNames ); // overload for composite unique keys","handlingStrategy":"validation","validationCode":"String sql;\nif ( propertyNames.length > 1 ) {\n    sql = persister.getSelectByUniqueKeyString(propertyNames, columnNames);\n}\nelse {\n    sql = persister.getSelectByUniqueKeyString(propertyNames);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat the single-array overload as single-property only; route composite keys to the (names, columns) overload","When migrating old persister code, grep for getSelectByUniqueKeyString call sites and check the array length","Unit-test the helper with a two-column unique key to pin the correct overload"],"tags":["hibernate","orm","unique-key","persister","api-migration"],"backgroundTag":"multi-column-unique-key-unsupported","analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}