Package org.springframework.orm.hibernate3

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


    }
   
    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 List findAdvancedCountries() {
        HibernateTemplate t = new HibernateTemplate(getSessionFactory());
       
        return (List)t.execute(
                new HibernateCallback() {
                    public Object doInHibernate(Session s) throws HibernateException, SQLException {
                        // TODO filtrer
                        return s.createCriteria(Country.class).list();
                    }
View Full Code Here

    }

    public List findEECCountries() {
        HibernateTemplate t = new HibernateTemplate(getSessionFactory());
       
        return (List)t.execute(
                new HibernateCallback() {
                    public Object doInHibernate(Session s) throws HibernateException, SQLException {
                        // TODO filtrer
                        return s.createCriteria(Country.class)
                          .add(Expression.eq("inEEC", new Integer(1)))
View Full Code Here

    }

  public Country findCountryFromName(final String country) {
        HibernateTemplate t = new HibernateTemplate(getSessionFactory());
       
        return (Country)t.execute(
                new HibernateCallback() {
                    public Object doInHibernate(Session s) throws HibernateException, SQLException {
                        return s.createCriteria(Country.class)
                          .add(Expression.eq("name", country))
                          .uniqueResult();
View Full Code Here

    public void fetch(WOJObject o) throws DaoException {
        if (o instanceof Order) {
            final Order order = (Order)o;
            HibernateTemplate t = new HibernateTemplate(getSessionFactory());
            t.execute(
                    new HibernateCallback() {
                        public Object doInHibernate(Session s) throws HibernateException, SQLException {
                            s.lock(order, LockMode.NONE);
                            if(order.getSuccessPayment() != null) {
                              order.getSuccessPayment().getTransactionId();
View Full Code Here

    }

    public Group[] findUpdatedGroups(final Long since) {
        HibernateTemplate t = new HibernateTemplate(getSessionFactory());

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

    public void fetch(WOJObject o) throws DaoException {
        if (o instanceof Group) {
            final Group g = (Group)o;
            HibernateTemplate t = new HibernateTemplate(getSessionFactory());
            t.execute(
                    new HibernateCallback() {
                        public Object doInHibernate(Session s) throws HibernateException, SQLException {
                            s.lock(g, LockMode.NONE);
                            g.getParent();
                            return null;
View Full Code Here

    }

  public Group[] findAdministratedGroups(final User user) {
        HibernateTemplate t = new HibernateTemplate(getSessionFactory());
       
        return (Group[])t.execute(
                new HibernateCallback() {
                    public Object doInHibernate(Session s) throws HibernateException, SQLException {

                    List foundGroups = s.createQuery(
                "Select usr.administratedGroup from UserImpl as usr where usr.id=" + user.getId())
View Full Code Here

        if (object instanceof InvoiceId) {
            final InvoiceId id = (InvoiceId)object;

            HibernateTemplate t = new HibernateTemplate(getSessionFactory());

            foundId = (InvoiceId) t.execute(
                new HibernateCallback() {
                    public Object doInHibernate(Session s) throws HibernateException, SQLException {
                        return s.createCriteria(getHandledClass()).add(Restrictions.eq("ident", id.getIdent())).uniqueResult();
                    }
                }
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.