我正在做餐厅任务
在RestaurantManager类中,我正在编码CRUD方法
说我有以下方法
public Restaurant updateRestaurant(Restaurant restaurant) {
//get emf from a singleton supplier
EntityManagerFactory emf = EMFSupplier.getInstance().getEMF();
EntityManager em = emf.createEntityManager();
Restaurant restaurantToBeUpdated = (Restaurant)em.find(Restaurant.class, restaurant.getRestaurantId);
// Here's my question
Set<Chefs> chefsFirstSet = restaurantToBeUpdated.getAllChefs();
Set<Chefs> chefsSecondSet = restaurant.getAllChefs();
//Both retrieve a set of chefs, one use Restaurant from em.find(),
//the other use "restaurant" parameter passed to this method
What's the difference between this two sets?
}