Class OrderDAO
java.lang.Object
org.silverpeas.components.gallery.dao.OrderDAO
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringcreateOrder(Collection<String> mediaIds, String userId, String instanceId) Persists a new order.static voiddeleteOrder(Order order) Deletes an order and its details.findByCriteria(MediaOrderCriteria criteria) Finds orders from the specified criteria.getAllOrderDetails(String orderId) Gets all medias of an order.static OrdergetByCriteria(MediaOrderCriteria criteria) Gets a unique result.static voidupdateOrder(Order order) Updates an order and its details.static voidupdateOrderRow(OrderRow row) Updates a row of an order.
-
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
Updates an order and its details.- Parameters:
order- an order.- Throws:
SQLException- if the update fails
-
deleteOrder
Deletes an order and its details.- Parameters:
order- an order.- Throws:
SQLException- if the deletion fails
-
getAllOrderDetails
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
Updates a row of an order.- Parameters:
row- details of an order.- Throws:
SQLException- if the update fails
-
getByCriteria
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
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
-