Package org.silverpeas.components.gallery.dao

# Class OrderDAO

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

public class OrderDAO extends Object

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static String`
  `createOrder(Collection<String> mediaIds, String userId, String instanceId)`
  Persists a new order.
  `static void`
  `deleteOrder(Order order)`
  Deletes an order and its details.
  `static List<Order>`
  `findByCriteria(MediaOrderCriteria criteria)`
  Finds orders from the specified criteria.
  `static List<OrderRow>`
  `getAllOrderDetails(String orderId)`
  Gets all medias of an order.
  `static Order`
  `getByCriteria(MediaOrderCriteria criteria)`
  Gets a unique result.
  `static void`
  `updateOrder(Order order)`
  Updates an order and its details.
  `static void`
  `updateOrderRow(OrderRow row)`
  Updates a row of an order.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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`