@Override @Test public void count () { Assert.assertEquals (dao.count (), howMany ()); Assert.assertEquals (dao.count (udao.getRootUser ()), howMany ()); Assert.assertEquals (dao.count (udao.read ("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0")), 3); }
public int count (User user) { String userString = ""; if ( !cfgManager.isDataPublic () && (user != null) && !user.getRoles ().contains (Role.DATA_MANAGER)) { userString = "WHERE ('" + user.getUUID () + "' in elements(authorizedUsers) OR '" + userDao.getPublicData ().getUUID () + "' in elements(authorizedUsers))"; } return DataAccessUtils .intResult (find ("select count(*) FROM Collection " + userString)); }
CollectionDao extends HibernateDao<Collection, String> { public int count (User user) { String userString = ""; if ( !cfgManager.isDataPublic () && (user != null) && !user.getRoles ().contains (Role.DATA_MANAGER)) { userString = "WHERE ('" + user.getUUID () + "' in elements(authorizedUsers) OR '" + userDao.getPublicData ().getUUID () + "' in elements(authorizedUsers))"; } return DataAccessUtils .intResult (find ("select count(*) FROM Collection " + userString)); } }
CollectionDao extends HibernateDao<Collection, String> { public int count (User user) { String userString = ""; if ( !cfgManager.isDataPublic () && (user != null) && !user.getRoles ().contains (Role.DATA_MANAGER)) { userString = "WHERE ('" + user.getUUID () + "' in elements(authorizedUsers) OR '" + userDao.getPublicData ().getUUID () + "' in elements(authorizedUsers))"; } return DataAccessUtils .intResult (find ("select count(*) FROM Collection " + userString)); }  }
CollectionDao extends HibernateDao<Collection, String> { public int count (User user) { String userString = ""; if ( !cfgManager.isDataPublic () && (user != null) && !user.getRoles ().contains (Role.DATA_MANAGER)) { userString = "WHERE ('" + user.getUUID () + "' in elements(authorizedUsers) OR '" + userDao.getPublicData ().getUUID () + "' in elements(authorizedUsers))"; } return DataAccessUtils .intResult (find ("select count(*) FROM Collection " + userString)); }  int count(User user); @Override void delete(final Collection collection); @Override void deleteAll(); Collection create(Collection collection, User user); boolean contains(final String cid, final Long pid); void removeProduct(final String cid, final Long pid, User user); void removeProducts(final String cid, final Long[] pids, User user); @SuppressWarnings ("unchecked") List<Collection> getCollectionsOfProduct(final Long product_id); List<Long> getProductIds(final String collection_uuid, User user); @SuppressWarnings ("unchecked") List<String> getAuthorizedCollections(String user_uuid); @SuppressWarnings ("unchecked") List<User> getAuthorizedUsers(final Collection collection); String getCollectionUUIDByName(final String collection_name); boolean hasAccessToCollection(final String cid, final String uid); Iterator<Collection> getAllCollections(); }
CollectionDao extends HibernateDao<Collection, String> { public int count (User user) { String userString = ""; if ( !cfgManager.isDataPublic () && (user != null) && !user.getRoles ().contains (Role.DATA_MANAGER)) { userString = "WHERE ('" + user.getUUID () + "' in elements(authorizedUsers) OR '" + userDao.getPublicData ().getUUID () + "' in elements(authorizedUsers))"; } return DataAccessUtils .intResult (find ("select count(*) FROM Collection " + userString)); }  int count(User user); @Override void delete(final Collection collection); @Override void deleteAll(); Collection create(Collection collection, User user); boolean contains(final String cid, final Long pid); void removeProduct(final String cid, final Long pid, User user); void removeProducts(final String cid, final Long[] pids, User user); @SuppressWarnings ("unchecked") List<Collection> getCollectionsOfProduct(final Long product_id); List<Long> getProductIds(final String collection_uuid, User user); @SuppressWarnings ("unchecked") List<String> getAuthorizedCollections(String user_uuid); @SuppressWarnings ("unchecked") List<User> getAuthorizedUsers(final Collection collection); String getCollectionUUIDByName(final String collection_name); boolean hasAccessToCollection(final String cid, final String uid); Iterator<Collection> getAllCollections(); final static String HIDDEN_PREFIX; final static String COLLECTION_ROOT_NAME; }