Maybe this is a stupid question but it\'s bugging me.
I have a bi-directional one to many relationship of Employee to Vehicles. When I persist an Employee in the dat
One way to do that is to set the cascade option on you "One" side of relationship:
class Employee {
//
@OneToMany(cascade = {CascadeType.PERSIST})
private Set vehicles = new HashSet();
//
}
by this, when you call
Employee savedEmployee = employeeDao.persistOrMerge(newEmployee);
it will save the vehicles too.