{"record":{"id":"4d51461842ff88dc","repo":"hibernate/hibernate-orm","slug":"null-key","errorCode":null,"errorMessage":"Null key","messagePattern":"Null key","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/internal/find/AbstractFindMultipleByKeyOperation.java","lineNumber":177,"sourceCode":"\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate void enabledFetchProfile(String profileName) {\n\t\tif ( enabledFetchProfiles == null ) {\n\t\t\tenabledFetchProfiles = new HashSet<>();\n\t\t}\n\t\tenabledFetchProfiles.add( profileName );\n\t}\n\n\tprotected void checkKeys(List<?> keys) {\n\t\tif ( keys == null ) {\n\t\t\tthrow new IllegalArgumentException( \"Null keys\" );\n\t\t}\n\t\tfor ( Object key : keys ) {\n\t\t\tif ( key == null ) {\n\t\t\t\tthrow new IllegalArgumentException( \"Null key\" );\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected void checkFindRequirements(List<?> keys, SharedSessionContractImplementor session) {\n\t\tcheckKeys( keys );\n\t\tcheckTransactionNeededForLock( session, getLockMode() );\n\t}\n\n\tpublic List<T> performFind(\n\t\t\tList<?> keys,\n\t\t\t@Nullable GraphSemantic graphSemantic,\n\t\t\t@Nullable RootGraphImplementor<T> rootGraph) {\n\t\tfinal var session = getSession();\n\t\tcheckFindRequirements( keys, session );\n\t\treturn getKeyType() == KeyType.NATURAL\n\t\t\t\t? findByNaturalIds( keys, session, graphSemantic, rootGraph )\n\t\t\t\t: findByIds( keys, session, graphSemantic, rootGraph );","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/internal/find/AbstractFindMultipleByKeyOperation.java#L159-L195","documentation":"Error \"Null key\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Thrown at hibernate-core/src/main/java/org/hibernate/internal/find/AbstractFindMultipleByKeyOperation.java:177 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a non-null key; check each id for null before the find call."],"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"}