app/repository/TripDestinationsRepository.java
public CompletionStage<Optional<Integer>> delete(int tripDestinationId) {
        return supplyAsync(() -> {
            try {
                final Optional<TripDestination> tripDestOptional = Optional.ofNullable(ebeanServer.find(TripDestination.class).setId(tripDestinationId).findOne());
                tripDestOptional.ifPresent(Model::delete);
                return tripDestOptional.map(TripDestination::getTripDestinationId);
            } catch (Exception e) {
                return Optional.empty();
            }
        }, executionContext);
    }
/**
     * remove a trip destination from the database
     * @param tripDestinationId Id of the trip to be deleted
     * @return optional of the deleted trip destinations id
     */
remove a trip destination from the database
@param tripDestinationId Id of the trip to be deleted
@return optional of the deleted trip destinations id
remove a trip destination from the database @param tripDestinationId Id of the trip to be deleted @return optional of the deleted trip destinations id
public CompletionStage<Optional<Integer>> delete(int tripDestinationId) {
        return supplyAsync(() -> {
            try {
                final Optional<TripDestination> tripDestOptional = Optional.ofNullable(ebeanServer.find(TripDestination.class).setId(tripDestinationId).findOne());
                tripDestOptional.ifPresent(Model::delete);
                return tripDestOptional.map(TripDestination::getTripDestinationId);
            } catch (Exception e) {
                return Optional.empty();
            }
        }, executionContext);
    }
public CompletionStage < Optional < Integer > > delete ( int tripDestinationId ) { return supplyAsync ( ( ) -> { try { final Optional < TripDestination > tripDestOptional = Optional . ofNullable ( ebeanServer . find ( TripDestination . class ) . setId ( tripDestinationId ) . findOne ( ) ) ; tripDestOptional . ifPresent ( Model :: delete ) ; return tripDestOptional . map ( TripDestination :: getTripDestinationId ) ; } catch ( Exception e ) { return Optional . empty ( ) ; } } , executionContext ) ; }
remove a trip destination from the database
 @param tripDestinationId Id of the trip to be deleted
 @return optional of the deleted trip destinations id
remove a trip destination from the database @param tripDestinationId Id of the trip to be deleted @return optional of the deleted trip destinations id