private Vehicle update(Vehicle vehicle) { template.update( "UPDATE vehicles SET manufacturer = ?, model = ? WHERE id = ?", vehicle.getManufacturer(), vehicle.getModel(), vehicle.getId()); return vehicle; }
public void setVehicleAssignment(int incidentID, int vehicleID) { for (Vehicle vehicle : vehicles) { if (vehicle.getId() == vehicleID) { vehicle.setAvailable(false); vehicle.assignIncident(incidentID); } } persistVehicles(); }
/** Set the Vehicle */ public void setVehicle(Vehicle v) { m_vehicle = v; setVehicleId(v.getId()); }
@Override @Transactional public void delete(Vehicle vehicle) { template.update("DELETE FROM vehicles WHERE id = ?", vehicle.getId()); }