Esempio n. 1
0
 @Override
 @ExecutionMarkers.AmendMethod
 public void save(Account account) {
   if (account.getId() != 0) {
     SessionProvider.SELF.getSession().saveOrUpdate(account);
   } else {
     SessionProvider.SELF.getSession().save(account);
   }
 }
Esempio n. 2
0
 @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;
 }
Esempio n. 3
0
 @Override
 @ExecutionMarkers.FetchMethod
 public Collection<Account> getAll() {
   return SessionProvider.SELF.getSession().createCriteria(Account.class).list();
 }
Esempio n. 4
0
 @Override
 @ExecutionMarkers.AmendMethod
 public void delete(int id) {
   SessionProvider.SELF.getSession().delete(new Account().setId(id));
 }