public static List<Proxy> allProxies() { List<Proxy> proxies = new ArrayList<Proxy>(); List<Choco> chocos = find.all(); for (Choco choco : chocos) { proxies.add(choco.toProxy()); } return proxies; }
public static Boolean update(final Choco choco) { Choco dbChoco = Ebean.find(Choco.class, choco.getId()); dbChoco.setId(choco.getId()); dbChoco.setShortDescription(choco.getShortDescription()); dbChoco.setDescription(choco.getDescription()); dbChoco.setUser(choco.getUser()); dbChoco.save(); Logger.debug("Choco UPDATE : " + choco.id); return true; }
public static Long create(Choco choco) { choco.save(); Logger.debug("Choco CREATE : " + choco.getId()); return choco.getId(); }