app/repository/DestinationPhotoRepository.java
public boolean isLinkedToDestByOtherUser(int profileId, int photoId, int destinationId) {
        List<DestinationPhoto>  destPhotoList = ebeanServer.find(DestinationPhoto.class).where()
                .eq("photo_id", photoId)
                .eq("destination_id", destinationId)
                .findList();
        if (!destPhotoList.isEmpty()) {
            if (destPhotoList.size() > 1) {
                return true;
            }
            return destPhotoList.get(0).getProfileId() != profileId;
        }
        return false;
    }
/**
     * Logic to check if a photo is linked to another destination
     * @param profileId Id of the profile linked to a photo
     * @param photoId id of the photo being linked
     * @param destinationId Id of the destination that the photo and profile is linked to
     * @return
     */
Logic to check if a photo is linked to another destination
@param profileId Id of the profile linked to a photo
@param photoId id of the photo being linked
@param destinationId Id of the destination that the photo and profile is linked to
@return
Logic to check if a photo is linked to another destination @param profileId Id of the profile linked to a photo @param photoId id of the photo being linked @param destinationId Id of the destination that the photo and profile is linked to @return
public boolean isLinkedToDestByOtherUser(int profileId, int photoId, int destinationId) {
        List<DestinationPhoto>  destPhotoList = ebeanServer.find(DestinationPhoto.class).where()
                .eq("photo_id", photoId)
                .eq("destination_id", destinationId)
                .findList();
        if (!destPhotoList.isEmpty()) {
            if (destPhotoList.size() > 1) {
                return true;
            }
            return destPhotoList.get(0).getProfileId() != profileId;
        }
        return false;
    }
public boolean isLinkedToDestByOtherUser ( int profileId , int photoId , int destinationId ) { List < DestinationPhoto > destPhotoList = ebeanServer . find ( DestinationPhoto . class ) . where ( ) . eq ( "photo_id" , photoId ) . eq ( "destination_id" , destinationId ) . findList ( ) ; if ( ! destPhotoList . isEmpty ( ) ) { if ( destPhotoList . size ( ) > 1 ) { return true ; } return destPhotoList . get ( 0 ) . getProfileId ( ) != profileId ; } return false ; }
Logic to check if a photo is linked to another destination
 @param profileId Id of the profile linked to a photo
 @param photoId id of the photo being linked
 @param destinationId Id of the destination that the photo and profile is linked to
 @return
Logic to check if a photo is linked to another destination @param profileId Id of the profile linked to a photo @param photoId id of the photo being linked @param destinationId Id of the destination that the photo and profile is linked to @return