@Test public void getUserSearches () { List<Search> s = dao.getUserSearches (dao.read ("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0")); Assert.assertEquals (s.size (), 2); }
public List<Search> getUserSearches (User user) { Set<Search> searches = read (user.getUUID ()).getPreferences (). getSearches (); List<Search> list = new ArrayList<Search> (searches); Collections.sort (list, new Comparator<Search> () { @Override public int compare (Search arg0, Search arg1) { return arg0.getValue ().compareTo (arg1.getValue ()); } }); return list; }
UserDao extends HibernateDao<User, String> { public List<Search> getUserSearches (User user) { Set<Search> searches = read (user.getUUID ()).getPreferences (). getSearches (); List<Search> list = new ArrayList<Search> (searches); Collections.sort (list, new Comparator<Search> () { @Override public int compare (Search arg0, Search arg1) { return arg0.getValue ().compareTo (arg1.getValue ()); } }); return list; } }
UserDao extends HibernateDao<User, String> { public List<Search> getUserSearches (User user) { Set<Search> searches = read (user.getUUID ()).getPreferences (). getSearches (); List<Search> list = new ArrayList<Search> (searches); Collections.sort (list, new Comparator<Search> () { @Override public int compare (Search arg0, Search arg1) { return arg0.getValue ().compareTo (arg1.getValue ()); } }); return list; }  }
UserDao extends HibernateDao<User, String> { public List<Search> getUserSearches (User user) { Set<Search> searches = read (user.getUUID ()).getPreferences (). getSearches (); List<Search> list = new ArrayList<Search> (searches); Collections.sort (list, new Comparator<Search> () { @Override public int compare (Search arg0, Search arg1) { return arg0.getValue ().compareTo (arg1.getValue ()); } }); return list; }  User getByName(final String name); @Override void delete(final User user); void removeUser(User user); @SuppressWarnings ("unchecked") List<User> scrollNotDeleted(final int skip, final int top); Iterator<User> scrollForDataRight(); @SuppressWarnings ("unchecked") List<User> readNotDeleted(); Iterator<User> scrollNotDeleted(final String filter, int skip); Iterator<User> scrollForDataRight(String filter, int skip); Iterator<User> scrollAll(String filter, int skip); int countNotDeleted(String filter); int countForDataRight(String filter); int countAll(String filter); void addAccessToCollection(User user, Collection collection); void removeAccessToCollection(String user_uuid, Collection collection); String computeUserCode(User user); User getUserFromUserCode(String code); void lockUser(User user, String reason); void unlockUser(User user, Class<? extends AccessRestriction> car); void createTmpUser(User user); @Override User create(User u); void registerTmpUser(User u); boolean isTmpUser(User u); void cleanupTmpUser(int max_days); User getRootUser(); boolean isRootUser(User user); void storeUserSearch(User user, String request, String footprint,
         HashMap<String, String> advanced, String complete); void removeUserSearch(User user, String uuid); void activateUserSearchNotification(String uuid, boolean notify); void clearUserSearches(User user); List<Search> getUserSearches(User user); FileScanner addFileScanner(User user, String url, String username,
         String password, String pattern, String cron_schedule,
         Set<Collection> collections); void updateFileScanner(Long scan_id, String url, String username,
         String password, String pattern, String cron_schedule,
         Set<Collection> collections); void removeFileScanner(User user, Long scanner_id); void setFileScannerActive(Long id, boolean active); FileScanner findFileScanner(User user, String url, String username); Set<FileScanner> getFileScanners(User user); User getPublicData(); String getPublicDataName(); Iterator<User> scrollNotDeletedByFilter(String filter, int skip); int countNotDeletedByFilter(String filter); List<User> getUsers(String filter, String order_by, final int skip,
      final int top); int countUsers(String filter); Iterator<User> getAllUsers(); }
UserDao extends HibernateDao<User, String> { public List<Search> getUserSearches (User user) { Set<Search> searches = read (user.getUUID ()).getPreferences (). getSearches (); List<Search> list = new ArrayList<Search> (searches); Collections.sort (list, new Comparator<Search> () { @Override public int compare (Search arg0, Search arg1) { return arg0.getValue ().compareTo (arg1.getValue ()); } }); return list; }  User getByName(final String name); @Override void delete(final User user); void removeUser(User user); @SuppressWarnings ("unchecked") List<User> scrollNotDeleted(final int skip, final int top); Iterator<User> scrollForDataRight(); @SuppressWarnings ("unchecked") List<User> readNotDeleted(); Iterator<User> scrollNotDeleted(final String filter, int skip); Iterator<User> scrollForDataRight(String filter, int skip); Iterator<User> scrollAll(String filter, int skip); int countNotDeleted(String filter); int countForDataRight(String filter); int countAll(String filter); void addAccessToCollection(User user, Collection collection); void removeAccessToCollection(String user_uuid, Collection collection); String computeUserCode(User user); User getUserFromUserCode(String code); void lockUser(User user, String reason); void unlockUser(User user, Class<? extends AccessRestriction> car); void createTmpUser(User user); @Override User create(User u); void registerTmpUser(User u); boolean isTmpUser(User u); void cleanupTmpUser(int max_days); User getRootUser(); boolean isRootUser(User user); void storeUserSearch(User user, String request, String footprint,
         HashMap<String, String> advanced, String complete); void removeUserSearch(User user, String uuid); void activateUserSearchNotification(String uuid, boolean notify); void clearUserSearches(User user); List<Search> getUserSearches(User user); FileScanner addFileScanner(User user, String url, String username,
         String password, String pattern, String cron_schedule,
         Set<Collection> collections); void updateFileScanner(Long scan_id, String url, String username,
         String password, String pattern, String cron_schedule,
         Set<Collection> collections); void removeFileScanner(User user, Long scanner_id); void setFileScannerActive(Long id, boolean active); FileScanner findFileScanner(User user, String url, String username); Set<FileScanner> getFileScanners(User user); User getPublicData(); String getPublicDataName(); Iterator<User> scrollNotDeletedByFilter(String filter, int skip); int countNotDeletedByFilter(String filter); List<User> getUsers(String filter, String order_by, final int skip,
      final int top); int countUsers(String filter); Iterator<User> getAllUsers();  }