Class ClientStorage


  • public class ClientStorage
    extends java.lang.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 Detail

      • ClientStorage

        public ClientStorage​(ClientDAO clientDAO)

        Constructor for ClientStorage.

        Parameters:
        clientDAO - a ClientDAO object.
    • Method Detail

      • createClient

        public Client createClient​(Client client)
                            throws java.lang.Exception

        createClient.

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

        public Client updateClient​(Client client)
                            throws java.lang.Exception

        updateClient.

        Parameters:
        client - a Client object.
        Returns:
        a Client object.
        Throws:
        java.lang.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 java.util.List<Client> getClients()

        getClients.

        Returns:
        a List object.
      • countClients

        public long countClients()

        countClients.

        Returns:
        a long.