Class ClientStorage
- java.lang.Object
-
- org.exoplatform.timetracker.storage.ClientStorage
-
public class ClientStorage extends java.lang.ObjectStorage 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 Summary
Constructors Constructor Description ClientStorage(ClientDAO clientDAO)Constructor for ClientStorage.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longcountClients()countClients.ClientcreateClient(Client client)createClient.voiddeleteClient(long clientId)deleteClient.ClientgetClientById(long ClientId)getClientById.java.util.List<Client>getClients()getClients.ClienttoDTO(ClientEntity clientEntity)toDTO.ClientEntitytoEntity(Client client)toEntity.ClientupdateClient(Client client)updateClient.
-
-
-
Method Detail
-
deleteClient
public void deleteClient(long clientId) throws org.gatein.api.EntityNotFoundExceptiondeleteClient.
- Parameters:
clientId- a long.- Throws:
org.gatein.api.EntityNotFoundException- if any.
-
getClientById
public Client getClientById(long ClientId)
getClientById.
- Parameters:
ClientId- a long.- Returns:
- a
Clientobject.
-
getClients
public java.util.List<Client> getClients()
getClients.
- Returns:
- a
Listobject.
-
countClients
public long countClients()
countClients.
- Returns:
- a long.
-
toDTO
public Client toDTO(ClientEntity clientEntity)
toDTO.
- Parameters:
clientEntity- aClientEntityobject.- Returns:
- a
Clientobject.
-
toEntity
public ClientEntity toEntity(Client client)
toEntity.
- Parameters:
client- aClientobject.- Returns:
- a
ClientEntityobject.
-
-