Package org.springframework.orm.hibernate3

Examples of org.springframework.orm.hibernate3.HibernateTemplate.execute()


    }
   
    public List findAll(final Class c) {
        HibernateTemplate t = new HibernateTemplate(this._sessionFactory);
       
        return (List)t.execute(
                new HibernateCallback() {
                    public Object doInHibernate(Session s) throws HibernateException, SQLException {
                        return s.createCriteria(c).list();
                    }
                }
View Full Code Here


    }
   
    public void doSave(final WOJObject o) throws DaoException {
        HibernateTemplate t = new HibernateTemplate(this._sessionFactory);
       
        t.execute(
                new HibernateCallback() {
                    public Object doInHibernate(Session s) throws HibernateException, SQLException {
                        s.saveOrUpdate(o);
                        return null;
                    }
View Full Code Here

    }
   
    public void doRemove(final WOJObject o) throws DaoException {
        HibernateTemplate t = new HibernateTemplate(this._sessionFactory);
       
        t.execute(
                new HibernateCallback() {
                    public Object doInHibernate(Session s) throws HibernateException, SQLException {
                        s.delete(o);
                        return null;
                    }
View Full Code Here

    }

    public ProductPoint get(final Product p, final int years, final int type) {
        HibernateTemplate t = new HibernateTemplate(getSessionFactory());

        return (ProductPoint)t.execute(
            new HibernateCallback() {
                public Object doInHibernate(Session s) throws HibernateException, SQLException {
                    return s.createCriteria(getHandledClass())
                        .add(Restrictions.eq("product", p))
                        .add(Restrictions.eq("years", new Integer(years)))
View Full Code Here

    }
   
    public List get(final Product p, final int type) {
        HibernateTemplate t = new HibernateTemplate(getSessionFactory());

        return (List)t.execute(
            new HibernateCallback() {
                public Object doInHibernate(Session s) throws HibernateException, SQLException {
                    return s.createCriteria(getHandledClass())
                        .add(Restrictions.eq("product", p))
                        .add(Restrictions.eq("type", new Integer(type)))
View Full Code Here

    }

    public User findUser(final String login) {
        HibernateTemplate t = new HibernateTemplate(getSessionFactory());
       
        return (User)t.execute(
                new HibernateCallback() {
                    public Object doInHibernate(Session s) throws HibernateException, SQLException {
                      LOGGER.debug("finding user from login " + login);
                     
                      List foundUsers = s.createCriteria(User.class)
View Full Code Here

        );
    }
    public User[] findUpdatedUsers(final Long since) {
        HibernateTemplate t = new HibernateTemplate(getSessionFactory());

        return (User[])t.execute(
                new HibernateCallback() {
                    public Object doInHibernate(Session s) throws HibernateException, SQLException {
                      LOGGER.debug("finding users updated since " + since);
                     
                      List foundUsers = s.createCriteria(User.class)
View Full Code Here

        );
    }
    public User[] findUsersByRequest(final String request, final int from, final int size) {
        HibernateTemplate t = new HibernateTemplate(getSessionFactory());
       
        return (User[])t.execute(
                new HibernateCallback() {
                    public Object doInHibernate(Session s) throws HibernateException, SQLException {
                      LOGGER.debug("finding user between " + from + " and " + (from+size));
                      String reqToDo = request;
                      if (reqToDo.indexOf("from") == -1) {
View Full Code Here

    }

    public User[] findUsers(final int from, final int size) {
        HibernateTemplate t = new HibernateTemplate(getSessionFactory());
       
        return (User[])t.execute(
                new HibernateCallback() {
                    public Object doInHibernate(Session s) throws HibernateException, SQLException {
                      LOGGER.debug("finding user between " + from + " and " + (from+size));
                     
                      List foundUsers = s.createCriteria(UserImpl.class)
View Full Code Here

    public void fetch(final WOJObject o) throws DaoException {
        if (o instanceof UserImpl) {
            final UserImpl u = (UserImpl)o;
            HibernateTemplate t = new HibernateTemplate(getSessionFactory());
            t.execute(
                    new HibernateCallback() {
                        public Object doInHibernate(Session s) throws HibernateException, SQLException {
                            s.lock(u, LockMode.NONE);
                            u.getBuyedLicenses().size();
                            return null;
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.