app/repository/DestinationPhotoRepository.java
public CompletionStage<Optional<Integer>> insert(DestinationPhoto photo) {
        return supplyAsync(() -> {
            try {
                ebeanServer.insert(photo);
            } catch (Exception e) {
                e.printStackTrace();
            }
           return Optional.of(photo.getDestinationPhotoId());
        }, executionContext);
    }
/**
     * Inserts a new destination photo into the database
     *
     * @param photo the destination photo to be inserted
     * @return Optional of the destination photo id in a completion stage
     */
Inserts a new destination photo into the database
@param photo the destination photo to be inserted
@return Optional of the destination photo id in a completion stage
Inserts a new destination photo into the database @param photo the destination photo to be inserted @return Optional of the destination photo id in a completion stage
public CompletionStage<Optional<Integer>> insert(DestinationPhoto photo) {
        return supplyAsync(() -> {
            try {
                ebeanServer.insert(photo);
            } catch (Exception e) {
                e.printStackTrace();
            }
           return Optional.of(photo.getDestinationPhotoId());
        }, executionContext);
    }
public CompletionStage < Optional < Integer > > insert ( DestinationPhoto photo ) { return supplyAsync ( ( ) -> { try { ebeanServer . insert ( photo ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } return Optional . of ( photo . getDestinationPhotoId ( ) ) ; } , executionContext ) ; }
Inserts a new destination photo into the database
 @param photo the destination photo to be inserted
 @return Optional of the destination photo id in a completion stage
Inserts a new destination photo into the database @param photo the destination photo to be inserted @return Optional of the destination photo id in a completion stage