title: ObjectDB relation ships
body: <p>I am trying to add a relationship "OneToMany" to a database i am creating to test if ObjectDB is any good for me.</p>
  
  <p>what I have tried so far:</p>
  
  <pre><code>@Entity
  public class Parent {
      @Id
      private int parentID;
      private int childFK;
      Set&lt;Child&gt; children;
  
      public Parent(int p,int c) {
      this.parentID = p;
      this.childFK = c;
      }
  
      @OneToMany(orphanRemoval=true)
      @JoinColumn(name="childFK")
      public Set&lt;Child&gt; getChildren(){
          return childern;
      }
  }
  </code></pre>
  
  <p>This child class is:</p>
  
  <pre><code>@Entity
  public class Child {
      @Id
      private int childID;
      private String name;
  
      public Child(int c,String n) {
      this.childID = c;
      this.name = n;
      }
  }
  </code></pre>
  
  <p>My main method is:</p>
  
  <pre><code>   EntityManagerFactory emf = Persistence.createEntityManagerFactory("$objectdb/db/test.odb");
     EntityManager em = emf.createEntityManager();
  
     em.getTransaction().begin();
  
     Parent p = new Parent(01,02);
     em.persist(p);
     Child c = new Child(02,"bob");
     em.persist(c);
  
     em.getTransaction().commit();
  </code></pre>
  
  <p>This creates the database no problem but no relationships exist.
  This is the was the documentations states how to do it.</p>
  
  <p>I have also tried adding the the actual instance of child to the database. This somewhat works as it then knows there is an instance of the database available but it then does not know how to use it.</p>
  
  <p>I have tried the query:</p>
  
  <pre><code> SELECT p.getChildren() FROM Parent p
  </code></pre>
  
  <p>This just returns no such method getChildren().</p>
  
  <p>Any ideas?</p>