app/repository/DestinationPhotoRepository.java
public CompletionStage<Optional<Integer>> update(DestinationPhoto photo, int id) {
        return supplyAsync(() -> {
            Transaction txn = ebeanServer.beginTransaction();
            String updateQuery = "UPDATE destination_photo SET profile_id = ? and photo_id = ? and destination_id = ? WHERE destination_photo_id = ?";
            Optional<Integer> value = Optional.empty();
            try{
                if (ebeanServer.find(DestinationPhoto.class).setId(id).findOne() != null) {
                    SqlUpdate query = Ebean.createSqlUpdate(updateQuery);
                    query.setParameter(1, photo.getProfileId());
                    query.setParameter(2, photo.getPhotoId());
                    query.setParameter(2, photo.getDestinationId());
                    query.setParameter(3, id);
                    query.execute();
                    txn.commit();
                    value = Optional.of(id);
                }
            } finally {
                txn.end();
            }
            return value;
        }, executionContext);
    }
/**
     * Update an existing destination photo in the personal_photo table
     * Updates the profile id, the photo id, and destination id
     * @param photo destination photo that has had the changes applied
     * @param id id of the destination photo entry to be updated.
     * @return an optional of the destination photo image id that has been updated
     */
Update an existing destination photo in the personal_photo table
Updates the profile id, the photo id, and destination id
@param photo destination photo that has had the changes applied
@param id id of the destination photo entry to be updated.
@return an optional of the destination photo image id that has been updated
Update an existing destination photo in the personal_photo table Updates the profile id the photo id and destination id @param photo destination photo that has had the changes applied @param id id of the destination photo entry to be updated . @return an optional of the destination photo image id that has been updated
public CompletionStage<Optional<Integer>> update(DestinationPhoto photo, int id) {
        return supplyAsync(() -> {
            Transaction txn = ebeanServer.beginTransaction();
            String updateQuery = "UPDATE destination_photo SET profile_id = ? and photo_id = ? and destination_id = ? WHERE destination_photo_id = ?";
            Optional<Integer> value = Optional.empty();
            try{
                if (ebeanServer.find(DestinationPhoto.class).setId(id).findOne() != null) {
                    SqlUpdate query = Ebean.createSqlUpdate(updateQuery);
                    query.setParameter(1, photo.getProfileId());
                    query.setParameter(2, photo.getPhotoId());
                    query.setParameter(2, photo.getDestinationId());
                    query.setParameter(3, id);
                    query.execute();
                    txn.commit();
                    value = Optional.of(id);
                }
            } finally {
                txn.end();
            }
            return value;
        }, executionContext);
    }
public CompletionStage < Optional < Integer > > update ( DestinationPhoto photo , int id ) { return supplyAsync ( ( ) -> { Transaction txn = ebeanServer . beginTransaction ( ) ; String updateQuery = "UPDATE destination_photo SET profile_id = ? and photo_id = ? and destination_id = ? WHERE destination_photo_id = ?" ; Optional < Integer > value = Optional . empty ( ) ; try { if ( ebeanServer . find ( DestinationPhoto . class ) . setId ( id ) . findOne ( ) != null ) { SqlUpdate query = Ebean . createSqlUpdate ( updateQuery ) ; query . setParameter ( 1 , photo . getProfileId ( ) ) ; query . setParameter ( 2 , photo . getPhotoId ( ) ) ; query . setParameter ( 2 , photo . getDestinationId ( ) ) ; query . setParameter ( 3 , id ) ; query . execute ( ) ; txn . commit ( ) ; value = Optional . of ( id ) ; } } finally { txn . end ( ) ; } return value ; } , executionContext ) ; }
Update an existing destination photo in the personal_photo table
 Updates the profile id, the photo id, and destination id
 @param photo destination photo that has had the changes applied
 @param id id of the destination photo entry to be updated.
Update an existing destination photo in the personal_photo table Updates the profile id the photo id and destination id @param photo destination photo that has had the changes applied @param id id of the destination photo entry to be updated .