Class ClientStorage

java.lang.Object
org.exoplatform.timetracker.storage.ClientStorage

public class ClientStorage extends Object
Storage service to access / load and save Clients. This service will be used , as well, to convert from JPA entity to DTO.
Version:
$Id: $Id
Author:
medamine
  • Constructor Details

    • ClientStorage

      public ClientStorage(ClientDAO clientDAO)

      Constructor for ClientStorage.

      Parameters:
      clientDAO - a ClientDAO object.
  • Method Details

    • createClient

      public Client createClient(Client client) throws Exception

      createClient.

      Parameters:
      client - a Client object.
      Returns:
      a Client object.
      Throws:
      Exception - if any.
    • updateClient

      public Client updateClient(Client client) throws Exception

      updateClient.

      Parameters:
      client - a Client object.
      Returns:
      a Client object.
      Throws:
      Exception - if any.
    • deleteClient

      public void deleteClient(long clientId) throws org.gatein.api.EntityNotFoundException

      deleteClient.

      Parameters:
      clientId - a long.
      Throws:
      org.gatein.api.EntityNotFoundException - if any.
    • getClientById

      public Client getClientById(long ClientId)

      getClientById.

      Parameters:
      ClientId - a long.
      Returns:
      a Client object.
    • getClients

      public List<Client> getClients()

      getClients.

      Returns:
      a List object.
    • countClients

      public long countClients()

      countClients.

      Returns:
      a long.
    • toDTO

      public Client toDTO(ClientEntity clientEntity)

      toDTO.

      Parameters:
      clientEntity - a ClientEntity object.
      Returns:
      a Client object.
    • toEntity

      public ClientEntity toEntity(Client client)

      toEntity.

      Parameters:
      client - a Client object.
      Returns:
      a ClientEntity object.