@Override @Test(dependsOnMethods = "count") public void delete () { String id = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1"; User root = udao.getRootUser (); int expectedCount = dao.count () - 1; Collection collection = dao.read (id); Assert.assertNotNull (collection); List<Long> products = dao.getProductIds (id, null); List<User> users = dao.getAuthorizedUsers (collection); dao.delete (collection); Assert.assertNull (dao.read (id)); Assert.assertEquals (dao.count (), expectedCount); for (Long pid : products) { Assert.assertNotNull (pdao.read (pid)); } for (User u : users) { Assert.assertNotNull (udao.read (u.getUUID ())); } }
@Override public void delete (final Collection collection) { fileScannerDao.deleteCollectionReferences (collection); super.delete (collection); }
CollectionDao extends HibernateDao<Collection, String> { @Override public void delete (final Collection collection) { fileScannerDao.deleteCollectionReferences (collection); super.delete (collection); } }
CollectionDao extends HibernateDao<Collection, String> { @Override public void delete (final Collection collection) { fileScannerDao.deleteCollectionReferences (collection); super.delete (collection); }  }
CollectionDao extends HibernateDao<Collection, String> { @Override public void delete (final Collection collection) { fileScannerDao.deleteCollectionReferences (collection); super.delete (collection); }  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> { @Override public void delete (final Collection collection) { fileScannerDao.deleteCollectionReferences (collection); super.delete (collection); }  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; }