Class OrderDAO

java.lang.Object
org.silverpeas.components.gallery.dao.OrderDAO

public class OrderDAO extends Object
  • Method Details

    • 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 - if the creation fails
    • updateOrder

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

      public static void deleteOrder(Order order) throws SQLException
      Deletes an order and its details.
      Parameters:
      order - an order.
      Throws:
      SQLException - if the deletion fails
    • 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 - if the query fails
    • updateOrderRow

      public static void updateOrderRow(OrderRow row) throws SQLException
      Updates a row of an order.
      Parameters:
      row - details of an order.
      Throws:
      SQLException - if the update fails
    • 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 - if the query fails
    • 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