0

I am trying to fetch List from table FlexiBooking and then add this to another list i.e. to move to another table and delete those entries fetched from this table. I have used HibernateTemplate() object, since the project is being done using Spring Framework. But I am getting exception that trying to delete Detatched object. What is the problem? Below is my code:

    @Override
public void moveToNormalBooking(User user,
        int no_of_seats) {
    String queryString  = "FROM FlexiBooking";
    HibernateTemplate hibernateTemplate = getHibernateTemplate();
    hibernateTemplate.setMaxResults(no_of_seats);
    List<FlexiBooking> flexiBookingsTobeMoved = hibernateTemplate.find(queryString);
    List<FlightBooking> flightBookings = new ArrayList<FlightBooking>(); 
    int i =0; 
    while(i < flexiBookingsTobeMoved.size()) {
        FlightBooking flightbooking = new FlightBooking();
        flightbooking.setCostPerTicket(flexiBookingsTobeMoved.get(i).getTotalCost());
        flightbooking.setDateOfJourney(flexiBookingsTobeMoved.get(i).getScheduledFlight().getScheduledFlightDate());
        Booking booking = new Booking();
        booking.setBooker(flexiBookingsTobeMoved.get(i).getUser());
        booking.setBookingDate(flexiBookingsTobeMoved.get(i).getBookingDate());
        booking.setBookingReferenceNo(flexiBookingsTobeMoved.get(i).getBookingReferenceNumber());
        booking.setCancelled(false);
        flightbooking.setBooking(booking);
        flightbooking.setFlightRoute(flexiBookingsTobeMoved.get(i).getScheduledFlight());
        flightbooking.setCouponCode(flexiBookingsTobeMoved.get(i).getCouponCode());
        flightBookings.add(flightbooking);
        i++;
    }
    hibernateTemplate.saveOrUpdateAll(flightBookings);
 //   hibernateTemplate.update(flexiBookingsTobeMoved);
    hibernateTemplate.deleteAll(flexiBookingsTobeMoved);
}

DAG provider returns refresh error code 517

Our team can't use the DAG right now.

When trying to add an item with the provider DagBankSeCUrityQA - Bank (14748) I get a refresh error code 517.

Example itemID: 15466424
Please assist.

Thanks, Michael.

4

0 回答 0