Skip to content

Instantly share code, notes, and snippets.

@mastersobg
Created August 21, 2013 16:47
Show Gist options
  • Select an option

  • Save mastersobg/6296959 to your computer and use it in GitHub Desktop.

Select an option

Save mastersobg/6296959 to your computer and use it in GitHub Desktop.
private static final String[] QUERY_GET_PERSONAL_PHOTOS_BY_FRIEND_ID = //
{ //
"SELECT * FROM " + TABLE_NAME + " WITH(NOLOCK)" + //
" WHERE " + C_USER_ID + "=?" + //
" AND " + C_USER_PHOTO_ALBUM_ID + " IS NULL" + //
" AND " + CRITERIA_NOTDELETED, //
" ", //empty parameter must set for every call
" ORDER BY " + C_SEQUENCE + " DESC"//
};
private final static int QUERY_GET_PERSONAL_PHOTOS_BY_FRIEND_ID_CRITERIA_NOT_REJECTED_INDEX = 1;
/**
* Фотографии друга.
*
* @param chunkProperties
* @param userId
* a user identificator
* @return ListChunk, заполненный PhotoED
* @throws DAOSysException
*/
public IListChunk<PhotoED> getPersonalPhotosByFriendId(IChunkProperties chunkProperties, Long userId)
throws DAOSysException {
QUERY_GET_PERSONAL_PHOTOS_BY_FRIEND_ID[QUERY_GET_PERSONAL_PHOTOS_BY_FRIEND_ID_CRITERIA_NOT_REJECTED_INDEX] = CRITERIA_NOT_REJECTED;
final String sql = StringUtils.join(QUERY_GET_PERSONAL_PHOTOS_BY_FRIEND_ID, " ");
return get(sql, chunkProperties, userId);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment