Package com.shipmentXpress.dao
Class ShipmentDaoImpl
java.lang.Object
com.shipmentXpress.dao.ShipmentDaoImpl
- All Implemented Interfaces:
ShipmentDao
Implementation of the ShipmentDao interface for managing shipments.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddShipment(Shipment shipment) Adds a new shipment to the system.deteleShipment(int shipmentId) Deletes a shipment based on its shipment ID.getShipment(int shipmentId) Retrieves a shipment based on its shipment ID.updateShipment(int shipmentId, String content, double weight, String address) Updates the details of a shipment.
-
Constructor Details
-
ShipmentDaoImpl
public ShipmentDaoImpl()
-
-
Method Details
-
addShipment
Adds a new shipment to the system.- Specified by:
addShipmentin interfaceShipmentDao- Parameters:
shipment- The Shipment object to be added.- Returns:
- A status message indicating the success or failure of the operation.
- Throws:
ShipmentException- If an error occurs while adding the shipment.
-
deteleShipment
Deletes a shipment based on its shipment ID.- Specified by:
deteleShipmentin interfaceShipmentDao- Parameters:
shipmentId- The ID of the shipment to be deleted.- Returns:
- A status message indicating the success or failure of the operation.
- Throws:
ShipmentException- If an error occurs while deleting the shipment.
-
updateShipment
public Shipment updateShipment(int shipmentId, String content, double weight, String address) throws ShipmentException Updates the details of a shipment.- Specified by:
updateShipmentin interfaceShipmentDao- Parameters:
shipmentId- The ID of the shipment to be updated.content- The new content description of the shipment.weight- The new weight of the shipment.address- The new recipient address of the shipment.- Returns:
- The updated Shipment object.
- Throws:
ShipmentException- If an error occurs while updating the shipment.
-
getShipment
Retrieves a shipment based on its shipment ID.- Specified by:
getShipmentin interfaceShipmentDao- Parameters:
shipmentId- The ID of the shipment to retrieve.- Returns:
- The Shipment object corresponding to the given ID.
- Throws:
ShipmentException- If an error occurs while retrieving the shipment.
-