Package org.springframework.orm.hibernate3

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


    }

    public void saveSong(Song song) {
    HibernateTemplate ht = getHibernateTemplate();
        try {
            ht.saveOrUpdate(song);
            song = (Song) ht.get(Song.class, song.getId());
        } catch (Exception e) {
            log.error(song.toString(), e);
        }
View Full Code Here


//    }
 
  public void saveObject(Object o) {
    HibernateTemplate ht = getHibernateTemplate();
        try {
            ht.saveOrUpdate(o);
        } catch (DataIntegrityViolationException e) {
            log.warn("DataIntegrityViolationException while saveOrUpdate(): \n\t" + e.getMessage() + "\n\t" + o.toString());
        }
    }
 
View Full Code Here

        return (user);
    }

    public void saveUser(User user) {
    HibernateTemplate ht = getHibernateTemplate();
    ht.saveOrUpdate(user);
    user = (User) ht.get(User.class, user.getId());
    ht.flush();
  }

  public List<User> getUsers() {
View Full Code Here

            throw JournalException.wrapperException(new IllegalArgumentException(Messages.Error.IAE_NULL));
        }

        try {
            final HibernateTemplate hibernateTemplate = getHibernateTemplate();
            hibernateTemplate.saveOrUpdate(object);
            hibernateTemplate.flush();
        } catch (final HibernateSystemException hse) {
            LOGGER.error(hse.getMessage());
        } catch (final DataAccessException dae) {
            final Throwable cause = dae.getCause();
View Full Code Here

        HibernateTemplate ht = getHibernateTemplate(entityName, tableName, rowSet, ACTION_TYPE_STORE);

        try {
            // save the form data
            for (FormRow row : rowSet) {
                ht.saveOrUpdate(entityName, row);
            }
            ht.flush();
        } finally {
            closeSession(ht);
        }
View Full Code Here

        return save;
    }

    protected void saveOrUpdate(String entityName, Object obj) {
        HibernateTemplate ht = findHibernateTemplate();
        ht.saveOrUpdate(entityName, obj);
        ht.flush();
    }

    protected void merge(String entityName, Object obj) {
        HibernateTemplate ht = findHibernateTemplate();
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.