class ProductCartDao extends HibernateDao<ProductCart, String> {

   @SuppressWarnings("unchecked")
   public ProductCart getCartOfUser(final User user)
   {
      List<ProductCart> result =
            (List<ProductCart>) getHibernateTemplate().find("from ProductCart where user=?", user);
      return (result.isEmpty()) ? null : result.get(0);
   }

}