Interface INotificationDAO

  • All Known Implementing Classes:
    MockNotificationDAO

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

      • loadById

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

        java.util.List<Notification> loadByDemand​(java.lang.String strDemandId,
                                                  java.lang.String strDemandTypeId,
                                                  java.lang.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

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

        java.util.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

        java.util.List<Notification> loadByDemandIdTypeIdCustomerId​(java.lang.String strDemandId,
                                                                    java.lang.String strDemandTypeId,
                                                                    java.lang.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​(java.lang.String strDemandId,
                                                            java.lang.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​(java.lang.String strDemandId,
                            java.lang.String strDemandTypeId,
                            java.lang.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

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

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

        java.util.List<Notification> loadByIds​(java.util.List<java.lang.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
      • reassignNotifications

        void reassignNotifications​(java.lang.String strOldCustomerId,
                                   java.lang.String strNewCustomerId)
        Reassign notifications
        Parameters:
        strOldCustomerId -
        strNewCustomerId -