Class OrderDAO


  • public class OrderDAO
    extends Object
    • Method Detail

      • createOrder

        public static String createOrder​(Collection<String> mediaIds,
                                         String userId,
                                         String instanceId)
                                  throws SQLException
        Persists a new order.
        Parameters:
        mediaIds - the identifier list of media to attach to a new order.
        userId - the identifier of the user that is creating the order.
        instanceId - the identifier of a component instance.
        Returns:
        the identifier of the new order.
        Throws:
        SQLException
      • updateOrder

        public static void updateOrder​(Order order)
                                throws SQLException
        Updates an order and its details.
        Parameters:
        order - an order.
        Throws:
        SQLException
      • deleteOrder

        public static void deleteOrder​(Order order)
                                throws SQLException
        Deletes an order and its details.
        Parameters:
        order - an order.
        Throws:
        SQLException
      • getAllOrderDetails

        public static List<OrderRow> getAllOrderDetails​(String orderId)
                                                 throws SQLException
        Gets all medias of an order.
        Parameters:
        orderId - identifier of an order.
        Returns:
        the list of details related of the given identifier of order.
        Throws:
        SQLException
      • updateOrderRow

        public static void updateOrderRow​(OrderRow row)
                                   throws SQLException
        Updates a row of an order.
        Parameters:
        row - details of an order.
        Throws:
        SQLException
      • getByCriteria

        public static Order getByCriteria​(MediaOrderCriteria criteria)
                                   throws SQLException
        Gets a unique result.
        Parameters:
        criteria - the criteria that permits to filter the result.
        Returns:
        the unique result of the query performed.
        Throws:
        SQLException
      • findByCriteria

        public static List<Order> findByCriteria​(MediaOrderCriteria criteria)
                                          throws SQLException
        Finds orders from the specified criteria.
        Parameters:
        criteria - the criteria that permits to filter the result.
        Returns:
        a list of orders, empty if no order found.
        Throws:
        SQLException