Class OrderDAO
- java.lang.Object
-
- org.silverpeas.components.gallery.dao.OrderDAO
-
public class OrderDAO extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringcreateOrder(Collection<String> mediaIds, String userId, String instanceId)Persists a new order.static voiddeleteOrder(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 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 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
-
-