title: One-to-many bidirectional mapping and persistance order issue
body: <p>I've got two entities that have a bidirectional one-to-many relationship:</p>
  
  <pre><code>@ManyToOne
  @JoinColumn(name = "department_id")
  public Department getDepartment() {
      return department;
  }
  
  @OneToMany(mappedBy="department")
  public Collection&lt;EmployeeMapping&gt; getEmployees() {
      return employees;
  }
  </code></pre>
  
  <p>Here is my unit test:</p>
  
  <pre><code>    Department object = new Department();
      object.setName("Test Department Object");
      assertEquals("Object ID is not persistent yet", 0L, object.getId());
      EmployeeMapping employee1 = new EmployeeMapping();
      employee1.setName("Employee 1");
      EmployeeMapping employee2 = new EmployeeMapping();
      employee2.setName("Employee 2");
      Collection&lt;EmployeeMapping&gt; collection = ImmutableSet.of( employee1, employee2 );
      object.setEmployees( collection );
      departmentDao.save(object);
      assertNotEquals("Object ID is persistent", 0L, object.getId());
  
      Department actualObject = departmentDao.get( object.getId() );
      assertEquals("The actual object in the database must be equal to the original value", object, actualObject);
  </code></pre>
  
  <p>employee1 and employee2 are not saved. After test execution they are not present in the table. actualObject - of the Departme type - does present.</p>
  
  <p>My question is why when I get a deparment using: <code>departmentDao.get( object.getId() );</code> the <code>actualObject</code> have a collection of employees, although they cannot be unnloaded from the table. They have not been saved. Maybe departmentDao uses a cache inside. I'm not sure, please explain it. </p>
  
  <p>Anyway, I'd like so <code>object</code> and <code>actualObject</code> would be not be equal in this test. How can I archive it? I expect them to be equal only when I save both employees.</p>
  
  <p>And the last question, the order of entities saving. Both employee and department have a link to each other. It's a bidirectional relationship. Should I save first a department and only then employees or the order does not matter? Could you please explain this for me.
  Thanks.</p>