class CollectionDao extends HibernateDao<Collection, String> {

   public boolean contains (final String cid, final Long pid)
   {
      Collection collection = read(cid);
      Hibernate.initialize (collection.getProducts());
      return collection.getProducts().contains(productDao.read(pid));
   }

}