public List<Picture> getPictures(Album album) { try { DefaultQueryParams<Album> queryParams = new DefaultQueryParams<Album>("getPicturesByAlbum"); queryParams.setParam("album", album); return queryExecutor.executeNamedQueryList(queryParams, Picture.class); } catch (NoResultException e) { return null; } }
public List<WallMessage> getMessages(User receiver) throws RepositoryException { try { DefaultQueryParams<User> queryParams = new DefaultQueryParams<User>("getMessageByUser"); queryParams.setParam("rec", receiver); List<WallMessage> result = queryExecutor.executeNamedQueryList(queryParams, WallMessage.class); return repositoryManager.retrieveContent(result, getPath(receiver)); } catch (NoResultException e) { return null; } }
public Picture getAlbumPicture(Album album) { try { DefaultQueryParams<Album> queryParams = new DefaultQueryParams<Album>("getPicturesByAlbum"); queryParams.setParam("album", album); queryParams.setCurrentRecord(0); queryParams.setRecordCount(1); Picture result = queryExecutor.executeNamedQuery(queryParams, Picture.class); return repositoryManager.retrieveContent(result, getPath(result.getAlbum())); } catch (Exception e) { return null; } }