title: EclipseLink + JPA @OneToOne - link missing
body: <p>I'm currently working with EclipseLink and MongoDB. I have a case wherein I have a @OneToOne mapping. Below is the code - </p>
  
  <pre><code>    //Parent.java
      @Entity
      @NoSql(dataFormat = DataFormatType.MAPPED)
      public class Parent {
          @Id
          @GeneratedValue
          @Field(name = "_id")
          private String id;
          private String parentName;
  
          @OneToOne(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY)
          private Child  child;
  
          public String getId() {
              return id;
          }
  
          public void setId(String id) {
              this.id = id;
      }
  
          public String getParentName() {
             return parentName;
         }
  
          public void setParentName(String parentName) {
             this.parentName = parentName;
          }
  
      public Child getChild() {
          return child;
      }
  
      public void setChild(Child child) {
          this.child = child;
      }
  
      }
  
      //Child.java
  
  
      @Entity
      @NoSql(dataFormat = DataFormatType.MAPPED)
      public class Child {
      @Id
      @GeneratedValue
      @Field(name = "_id")
      private String id;
  
      private String childName;
  
      public String getId() {
          return id;
      }
  
      public void setId(String id) {
          this.id = id;
      }
  
      public String getChildName() {
          return childName;
      }
  
      public void setChildName(String childName) {
          this.childName = childName;
      }
  
  }
  </code></pre>
  
  <p>With the above classes, I have persisted the objects in the following order.</p>
  
  <pre><code>Parent parent = new Parent();
  parent.setParentName("pname");
  
  // Create
  System.out.println("***************  Persisting *****************");
  
  Child child = new Child();
  child.setChildName("cname");
  daoService.createChild(child);
  
  Parent p = daoService.createParent(parent);
  
  p.setChild(child);
  daoService.updateEntity(p);
  
  Parent parent2 = daoService.readParent(p.getId());
  
   System.out.println("Child : " + parent2.getChild());
  
   Child c = daoService.readChild(parent2.getChild().getId());
   System.out.println("Child id : " + c.getId());
  </code></pre>
  
  <p>However, I see that in MongoDB there is no link between Parent and Child objects.</p>
  
  <p>The BSON structure from MongoDB after the persistence steps is as follows.</p>
  
  <pre><code>{
    "_id" : "53C67031BBD8A5FDA924868D",
    "PARENTNAME" : "pname",
    "CHILD__id" : null
  }
  
  {
    "_id" : "53C67031BBD8A5FDA924868C",
    "CHILDNAME" : "cname"
  }
  </code></pre>
  
  <p>Could anybody please let me know, what is that I am doing incorrectly here. </p>