Examples of DotHibernateException


Examples of com.dotmarketing.exception.DotHibernateException

  public static void saveWithPrimaryKey(Object obj, Serializable idthrows DotHibernateException{
    try{
      Session session = getSession();
      session.save(obj, id);
    }catch (Exception e) {
      throw new DotHibernateException("Unable to save Object with primary key " + id + " to Hibernate Session ", e);
    }try{
      Session session = getSession();
      session.flush();
    }catch (Exception e) {
      throw new DotHibernateException("Unable to flush Hibernate Session ", e);
    }
  }
View Full Code Here

Examples of com.dotmarketing.exception.DotHibernateException

    public static void evict(Object obj) throws DotHibernateException{
        Session session = getSession();
        try {
            session.evict(obj);
        } catch (HibernateException e) {
          throw new DotHibernateException("Unable to evict from Hibernate Session ", e);
        }
    }
View Full Code Here

Examples of com.dotmarketing.exception.DotHibernateException

        query.setFirstResult(firstResult);
      }
      i = ((Integer) query.list().iterator().next()).intValue();
      return i;
    }catch (Exception e) {
      throw new DotHibernateException("Unable to get count ", e);
    }
  }
View Full Code Here

Examples of com.dotmarketing.exception.DotHibernateException

    try{
      Session session = getSession();
      query = session.createQuery(x);
      query.setCacheable(useCache);
    }catch(Exception ex){
      throw new DotHibernateException("Error setting Query",ex);
    }
  }
View Full Code Here

Examples of com.dotmarketing.exception.DotHibernateException

    try{
    Session session = getSession();
      query = session.createSQLQuery(x, getTableName(thisClass), thisClass);
      query.setCacheable(useCache);
    }catch (Exception e) {
      throw new DotHibernateException("Error setting SQLQuery ", e);
    }
  }
View Full Code Here

Examples of com.dotmarketing.exception.DotHibernateException

    try{
      Session session = getSession();
      session.delete(obj);
      session.flush();
    }catch (Exception e) {
      throw new DotHibernateException("Error deleting object ", e);
    }
  }
View Full Code Here

Examples of com.dotmarketing.exception.DotHibernateException

  public static void delete(String sql) throws DotHibernateException {
    try{
      Session session = getSession();
      session.delete(sql);
    }catch (Exception e) {
      throw new DotHibernateException("Error deleteing SQL ", e);
    }
  }
View Full Code Here

Examples of com.dotmarketing.exception.DotHibernateException

  public static java.util.List find(String xthrows DotHibernateException{
    try{
      Session session = getSession();
      return (ArrayList) session.find(x);
    }catch (Exception e) {
      throw new DotHibernateException("Error executing a find on Hibernate Session ", e);
    }
  }
View Full Code Here

Examples of com.dotmarketing.exception.DotHibernateException

      }
      catch(Exception ex)
      {
        Logger.debug(HibernateUtil.class,ex.toString());
      }
      throw new DotHibernateException("Error loading object from Hibernate Session ", e);
    }
    }
View Full Code Here

Examples of com.dotmarketing.exception.DotHibernateException

      if (id == 0) {
        return thisClass.newInstance();
      }
        return session.get(thisClass, new Long(id));
    }catch (Exception e) {
      throw new DotHibernateException("Unable to get Object with id " + id + " from Hibernate Session ", e);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.