org.springframework.data.mapping.model.MappingException: Cannot create a reference to an object with a NULL id.

Spring JIRA | John Souza | 3 years ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.

    Root Cause Analysis

    1. org.springframework.data.mapping.model.MappingException

      Cannot create a reference to an object with a NULL id.

      at org.springframework.data.mongodb.core.convert.MappingMongoConverter.createDBRef()
    2. Spring Data MongoDB - Core
      MappingMongoConverter.toDBRef
      1. org.springframework.data.mongodb.core.convert.MappingMongoConverter.createDBRef(MappingMongoConverter.java:800)
      2. org.springframework.data.mongodb.core.convert.MappingMongoConverter.toDBRef(MappingMongoConverter.java:311)
      2 frames