Interface INotificationDAO

  • All Known Implementing Classes:
    MockNotificationDAO

    public interface INotificationDAO
    This interface represents a data access object for Notification object
    • Method Detail

      • loadById

        Optional<Notification> loadById​(int id)
        Finds notifications associated to the id
        Parameters:
        strId -
        Returns:
        the notification coresponding to given id.
      • loadByDemand

        List<Notification> loadByDemand​(String strDemandId,
                                        String strDemandTypeId,
                                        String strCustomerId)
        Finds notifications associated to the specified demand id and demand type id. The notifications must be sorted by date descending
        Parameters:
        strDemandId - the demand id
        strDemandTypeId - the demand type id
        Returns:
        the notifications. An empty list is returned if no notification has been found.
      • loadByDemandAndDate

        List<Notification> loadByDemandAndDate​(String strDemandId,
                                               String strDemandTypeId,
                                               long lDate)
        Get notification by demand ids and notification date
        Parameters:
        strDemandId -
        strDemandTypeId -
        lDate -
        Returns:
        the notification
      • loadByFilter

        List<Notification> loadByFilter​(NotificationFilter notificationFilter)
        Finds and populate notification according to the filter
        Parameters:
        notificationFilter - the filter
        Returns:
        the notifications. An empty list is returned if no notification has been found.
      • loadByDemandIdTypeIdCustomerId

        List<Notification> loadByDemandIdTypeIdCustomerId​(String strDemandId,
                                                          String strDemandTypeId,
                                                          String strCustomerId,
                                                          NotificationFilter filter)
        Finds and populate notification by demand id, type id, customer id
        Parameters:
        strDemandId -
        strDemandTypeId -
        strCustomerId -
        filter -
        Returns:
        the notifications. An empty list is returned if no notification has been found.
      • loadLastNotifByDemandIdAndDemandTypeId

        Notification loadLastNotifByDemandIdAndDemandTypeId​(String strDemandId,
                                                            String strDemandTypeId)
        Find last notification by demand id and demand type id
        Parameters:
        strDemandId -
        strDemandTypeId -
        Returns:
        last notification
      • insert

        Notification insert​(Notification notification)
        Inserts a notification
        Parameters:
        notification - the notification to insert
        Returns:
        the inserted notification
      • deleteByDemand

        void deleteByDemand​(String strDemandId,
                            String strDemandTypeId,
                            String strCustomerId)
        Deletes notifications associated to the specified demand id and demand type id
        Parameters:
        strDemandId - the demand id
        strDemandTypeId - the demand type id
      • loadIdsByFilter

        List<Integer> loadIdsByFilter​(NotificationFilter notificationFilter)
        Load the ids of the notification by filter
        Parameters:
        notificationFilter - The notification filter
        Returns:
        The list of notifications ids
      • loadDistinctDemandTypeIds

        List<String> loadDistinctDemandTypeIds()
        load distinct demand type ids
        Returns:
        the id list
      • loadByIds

        List<Notification> loadByIds​(List<Integer> listIds)
        Loads list by Ids
        Parameters:
        listIds -
        Returns:
        list of Notification
      • delete

        void delete​(int id)
        delete notification
        Parameters:
        id -
      • existsNotificationWithDemandTypeId

        boolean existsNotificationWithDemandTypeId​(int nDemandTypeId)
        test if a notification exists for the specified demand_type_id
        Parameters:
        nDemandTypeId -
        Returns:
        true id exists