@Override @ExecutionMarkers.AmendMethod public void save(Account account) { if (account.getId() != 0) { SessionProvider.SELF.getSession().saveOrUpdate(account); } else { SessionProvider.SELF.getSession().save(account); } }
@Override @ExecutionMarkers.FetchMethod public Account get(int id) { Account account = (Account) SessionProvider.SELF.getSession().get(Account.class, id); if (account != null) { Hibernate.initialize(account); } return account; }
@Override @ExecutionMarkers.FetchMethod public Collection<Account> getAll() { return SessionProvider.SELF.getSession().createCriteria(Account.class).list(); }
@Override @ExecutionMarkers.AmendMethod public void delete(int id) { SessionProvider.SELF.getSession().delete(new Account().setId(id)); }