public Macro create(int id, String name) { Macro m = (Macro) db.createModel(NAME); m.setId(id); m.setName(name); update(m); return m; }
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; }
public void remove(Macro macro) { Map m = db.getMap(NAME); m.remove(new Integer(macro.getId())); }
public void update(Macro macro) { Map m = db.getMap(NAME); m.put(new Integer(macro.getId()), macro); }
public Macro create(int id) { Macro m = (Macro) db.createModel(NAME); m.setId(id); update(m); return m; }