{"record":{"id":"caaa8ea47651437b","repo":"hibernate/hibernate-orm","slug":"null-copies-are-not-supported-by","errorCode":null,"errorMessage":"null copies are not supported by ","messagePattern":"null copies are not supported by ","errorType":"exception","errorClass":"NullPointerException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/event/spi/MergeContext.java","lineNumber":135,"sourceCode":"\t */\n\tpublic boolean containsKey(@Nonnull Object mergeEntity) {\n\t\tif ( mergeEntity == null ) {\n\t\t\tthrow new NullPointerException( \"null entities are not supported by \" + getClass().getName() );\n\t\t}\n\t\treturn mergeToManagedEntityXref.containsKey( mergeEntity );\n\t}\n\n\t/**\n\t * Returns true if this MergeContext contains a cross-reference from the specified managed entity\n\t * to a merge entity.\n\t * @param managedEntity must be non-null\n\t * @return true if this MergeContext contains a cross-reference from the specified managed entity\n\t * to a merge entity\n\t * @throws NullPointerException if managedEntity is null\n\t */\n\tpublic boolean containsValue(@Nonnull Object managedEntity) {\n\t\tif ( managedEntity == null ) {\n\t\t\tthrow new NullPointerException( \"null copies are not supported by \" + getClass().getName() );\n\t\t}\n\t\treturn managedToMergeEntityXref.containsKey( managedEntity );\n\t}\n\n\t/**\n\t * Returns an unmodifiable set view of the merge-to-managed entity cross-references contained in this MergeContext.\n\t * @return an unmodifiable set view of the merge-to-managed entity cross-references contained in this MergeContext\n\t *\n\t * @see Collections#unmodifiableSet(Set)\n\t */\n\tpublic @Nonnull Set<Map.Entry<Object,Object>> entrySet() {\n\t\treturn Collections.unmodifiableSet( mergeToManagedEntityXref.entrySet() );\n\t}\n\n\t/**\n\t * Returns the managed entity associated with the specified merge Entity.\n\t * @param mergeEntity the merge entity; must be non-null\n\t * @return  the managed entity associated with the specified merge Entity","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/event/spi/MergeContext.java#L117-L153","documentation":"Error \"null copies are not supported by \" thrown in hibernate/hibernate-orm.","triggerScenarios":"Thrown when a null key or value is put into the merge-to-managed mapping of a MergeContext.","commonSituations":"Typical situations: merging a graph containing null elements; cascade-merge reaching a null association or collection element.","solutions":["Do not register null managed copies in the merge context; ensure merge always produces a non-null copy."],"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"}