Ejemplo n.º 1
0
  @Transactional(readOnly = true)
  @Override
  public List showClientsByPortion(int portionSize) {
    if (portionSize < 1) throw new IllegalArgumentException();

    int size = (int) clientDao.getListSize();
    List clients = new LinkedList<>();
    for (int i = 0; i < size; i += portionSize) {
      clients.addAll(clientDao.listChunkOfClients(i, portionSize));
      clients.add(null);
    }
    return clients;
  }
Ejemplo n.º 2
0
  @Override
  public boolean createClientWithOperator(
      String operatorLogin, String name, String surname, String phone, String address)
      throws ClientException {

    Operator operator = operatorDao.read(operatorLogin);
    Client client = new Client(name, surname, phone, address, 0L, null, operator);
    clientDao.create(client);
    return false;
  }
Ejemplo n.º 3
0
 @Transactional(readOnly = true)
 @Override
 public List showClientsLastMonth() {
   return clientDao.listClientsLastMonth();
 }
Ejemplo n.º 4
0
 @Transactional(readOnly = true)
 @Override
 public List showClientsGtSum(int sum) {
   return clientDao.listClientsGtSum(sum);
 }
Ejemplo n.º 5
0
 @Transactional(readOnly = true)
 @Override
 public List showAllClients() {
   return clientDao.listAll();
 }
Ejemplo n.º 6
0
 @Transactional(readOnly = true)
 @Override
 public Client read(Long id) {
   return clientDao.read(id);
 }