예제 #1
0
 public Macro create(int id, String name) {
   Macro m = (Macro) db.createModel(NAME);
   m.setId(id);
   m.setName(name);
   update(m);
   return m;
 }
예제 #2
0
 public Macro get(String name) {
   Map m = db.getMap(NAME);
   Macro c;
   for (Iterator i = m.values().iterator(); i.hasNext(); ) {
     c = (Macro) i.next();
     if (c.getName().equals(name)) {
       return c;
     }
   }
   return null;
 }
예제 #3
0
 public void remove(Macro macro) {
   Map m = db.getMap(NAME);
   m.remove(new Integer(macro.getId()));
 }
예제 #4
0
 public void update(Macro macro) {
   Map m = db.getMap(NAME);
   m.put(new Integer(macro.getId()), macro);
 }
예제 #5
0
 public Macro create(int id) {
   Macro m = (Macro) db.createModel(NAME);
   m.setId(id);
   update(m);
   return m;
 }