Examples of saveOrUpdate()


Examples of org.hibernate.Session.saveOrUpdate()

    s1.evict( child.getParent() );
    assertFalse( s1.contains( child.getParent() ) );

    s2 = openSession();
    s2.getTransaction().begin();
    s2.saveOrUpdate( child );
    assertTrue( s2.contains( child ) );
    assertFalse( s1.contains( child ) );
    assertTrue( s2.contains( child.getParent() ) );
    assertFalse( s1.contains( child.getParent() ) );
    assertFalse( Hibernate.isInitialized( child.getChildren() ) );
View Full Code Here

Examples of org.hibernate.classic.Session.saveOrUpdate()

    if (!beanForm.validateRequired())
    {
        return; // Errors
    }
    Session session = getHibernateSession();
    session.saveOrUpdate(bean);
    session.getTransaction().commit();
    if (returnPage != null)
    {
      returnPage.info("Saved.");
      setResponsePage(returnPage);
View Full Code Here

Examples of org.hibernate.classic.Session.saveOrUpdate()

    Session s = openSession();
    Eye e = new Eye();
    e.setName("Eye Eye");
    Jay jay = new Jay(e);
    e.setJay(jay);
    s.saveOrUpdate(e);
    s.flush();
    s.connection().commit();
    s.close();

    s = openSession();
View Full Code Here

Examples of org.hibernate.classic.Session.saveOrUpdate()

    tx.commit();
    s.close();
    c.getOther().setClazz(Qux.class);
    s = openSession();
    tx = s.beginTransaction();
    s.saveOrUpdate(c);
    tx.commit();
    s.close();
    c.getOther().getOther().setClazz(Bar.class);
    s = openSession();
    tx = s.beginTransaction();
View Full Code Here

Examples of org.hibernate.classic.Session.saveOrUpdate()

    tx.commit();
    s.close();
    c.getOther().getOther().setClazz(Bar.class);
    s = openSession();
    tx = s.beginTransaction();
    s.saveOrUpdate(c);
    tx.commit();
    s.close();
    s = openSession();
    tx = s.beginTransaction();
    c = (Circular) s.load(Circular.class, id);
View Full Code Here

Examples of org.jtalks.jcommune.model.dao.PluginConfigurationDao.saveOrUpdate()

        String pluginName = updatedPlugin.getPluginName();
        PluginConfiguration configuration = pluginConfigurationDao.get(pluginName);
        boolean isActivated = updatedPlugin.isActivated();
        LOGGER.debug("Plugin activation for {} will be changed to {}.", pluginName, isActivated);
        configuration.setActive(isActivated);
        pluginConfigurationDao.saveOrUpdate(configuration);
        pLuginLoader.reloadPlugins(new NameFilter(updatedPlugin.getPluginName()));
    }
}
View Full Code Here

Examples of org.mokai.persist.MessageStore.saveOrUpdate()

    logCollectionSize(messages.size()); // log the size of the collection
    for (Message message : messages) {
      // update the message and send it
      message.setStatus(Message.STATUS_RETRYING);
      message.setModificationTime(new Date());
      messageStore.saveOrUpdate(message);

      if (message.getDirection().equals(Direction.TO_CONNECTIONS)) {
        producer.sendBody(UriConstants.CONNECTIONS_ROUTER, ExchangePattern.InOnly, message);
      } else if (message.getDirection().equals(Direction.TO_APPLICATIONS)) {
        producer.sendBody(UriConstants.APPLICATIONS_ROUTER, ExchangePattern.InOnly, message);
View Full Code Here

Examples of org.mokai.persist.jdbc.JdbcMessageStore.saveOrUpdate()

    DataSource dataSource = mockDataSource();
    JdbcMessageStore messageStore = createMessageStore(dataSource, handler);

    Message message = new Message();
    messageStore.saveOrUpdate(message);

    Assert.assertEquals(10L, ((Long) message.getId()).longValue());

    verify(handler).insertMessage(any(Connection.class), any(Message.class));
    verify(handler, never()).updateMessage(any(Connection.class), any(Message.class));
View Full Code Here

Examples of org.mokai.persist.mongo.MongoMessageStore.saveOrUpdate()

    message.setProperty("to", "3001111111");
    message.setProperty("from", "3542");
    message.setProperty("text", "this is a test");

    store.saveOrUpdate(message); // try to save the message

    Assert.assertNotNull(message.getId());

    DBCollection col = db.getCollection(MongoMessageStore.CONNECTIONS_MSGS);
    BasicDBObject obj = (BasicDBObject) col.findOne();
View Full Code Here

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
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.