1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
public class AccountTypeBusinessServiceImpl implements
AccountTypeBusinessService {
private AccountTypeDAO dao;
public AccountTypeBusinessServiceImpl(String lang) {
dao = AccountTypeDAO.getInstance(lang);
}
public synchronized void add(AccountTypeBU accountType,String lang) {
dao.add(AccountTypeBU.convertToDbEntity(accountType), lang);
}
public synchronized List<AccountTypeBU> findAll(String lang) {
List<AccountTypeBU> result = new ArrayList<AccountTypeBU>();
List<AccountTypeDb> list = dao.findAllByLang(lang);
for (int i = 0;i < list.size();i++) {
AccountTypeBU accountType = new AccountTypeBU(list.get(i),lang);
result.add(accountType);
}
return result;
}
public synchronized void remove(int id, String lang) {
dao.delete(id);
}
public synchronized void udpdate(AccountTypeBU accountType, String lang) {
}
public synchronized int count(String lang) {
return dao.count(lang);
}
public synchronized List<AccountTypeBU> findByIndex(int index,int max, String lang) {
List<AccountTypeBU> result = new ArrayList<AccountTypeBU>();
List<AccountTypeDb> list = dao.findByIndex(index, max,lang);
for (int i = 0;i < list.size();i++) {
AccountTypeBU accountType = new AccountTypeBU(list.get(i),lang);
result.add(accountType);
}
return result;
}
public AccountTypeBU findById(int id,String lang) {
return new AccountTypeBU (dao.findById(id,lang),lang);
}
} |
Partager