class ProductCartDao extends HibernateDao<ProductCart, String> {

   public void deleteProductReferences(final Product product)
   {
      getHibernateTemplate().execute(new HibernateCallback<Void>()
      {
         @Override
         public Void doInHibernate(Session session) throws HibernateException, SQLException
         {
            session.createSQLQuery("DELETE FROM CART_PRODUCTS p WHERE p.PRODUCT_ID = :pid")
                  .setParameter("pid", product.getId()).executeUpdate();
            return null;
         }
      });
   }

}