app/repository/TripDestinationsRepository.java
public void editTripId(TripDestination tripDestination, Integer newDestinationId) {
        Transaction txn = ebeanServer.beginTransaction();
        try {
            TripDestination targetTripDestination = ebeanServer.find(TripDestination.class).setId(tripDestination.getTripDestinationId()).findOne();
            if (targetTripDestination != null) {
                targetTripDestination.setDestinationId(newDestinationId);
                targetTripDestination.update();
                txn.commit();
            }
        } finally {
            txn.end();
        }
    }
/**
     * Method to update the trip destination ID inside a trip
     * called when a trip destination needs to be replaced by a new public destination
     * @param tripDestination Trip destination to be updated
     * @param newDestinationId new destination Id for the trip destination
     */
Method to update the trip destination ID inside a trip
called when a trip destination needs to be replaced by a new public destination
@param tripDestination Trip destination to be updated
@param newDestinationId new destination Id for the trip destination
Method to update the trip destination ID inside a trip called when a trip destination needs to be replaced by a new public destination @param tripDestination Trip destination to be updated @param newDestinationId new destination Id for the trip destination
public void editTripId(TripDestination tripDestination, Integer newDestinationId) {
        Transaction txn = ebeanServer.beginTransaction();
        try {
            TripDestination targetTripDestination = ebeanServer.find(TripDestination.class).setId(tripDestination.getTripDestinationId()).findOne();
            if (targetTripDestination != null) {
                targetTripDestination.setDestinationId(newDestinationId);
                targetTripDestination.update();
                txn.commit();
            }
        } finally {
            txn.end();
        }
    }
public void editTripId ( TripDestination tripDestination , Integer newDestinationId ) { Transaction txn = ebeanServer . beginTransaction ( ) ; try { TripDestination targetTripDestination = ebeanServer . find ( TripDestination . class ) . setId ( tripDestination . getTripDestinationId ( ) ) . findOne ( ) ; if ( targetTripDestination != null ) { targetTripDestination . setDestinationId ( newDestinationId ) ; targetTripDestination . update ( ) ; txn . commit ( ) ; } } finally { txn . end ( ) ; } }
Method to update the trip destination ID inside a trip
 called when a trip destination needs to be replaced by a new public destination
 @param tripDestination Trip destination to be updated
 @param newDestinationId new destination Id for the trip destination
Method to update the trip destination ID inside a trip called when a trip destination needs to be replaced by a new public destination @param tripDestination Trip destination to be updated @param newDestinationId new destination Id for the trip destination