Ejemplo n.º 1
0
 public static void merge(List<Capacity> listToMerge) {
   for (Capacity cap : listToMerge) {
     Capacity c = Capacity.find("byWorkplaceAndUser", cap.workplace, cap.user).first();
     c.merge(cap);
     c.save();
   }
 }
Ejemplo n.º 2
0
 public static void deleteAll(String userName) {
   List<Capacity> caps = Capacity.find("byUser", userName).fetch();
   for (Capacity capacity : caps) {
     capacity.delete();
   }
 }