Example usage for org.hibernate ReplicationMode LATEST_VERSION

List of usage examples for org.hibernate ReplicationMode LATEST_VERSION

Introduction

In this page you can find the example usage for org.hibernate ReplicationMode LATEST_VERSION.

Prototype

ReplicationMode LATEST_VERSION

To view the source code for org.hibernate ReplicationMode LATEST_VERSION.

Click Source Link

Document

When a row already exists, choose the latest version.

Usage

From source file:org.springframework.orm.hibernate3.HibernateTemplateTests.java

License:Apache License

@Test
public void testReplicate() throws HibernateException {
    TestBean tb = new TestBean();
    given(session.getFlushMode()).willReturn(FlushMode.AUTO);
    hibernateTemplate.replicate(tb, ReplicationMode.LATEST_VERSION);
    verify(session).replicate(tb, ReplicationMode.LATEST_VERSION);
    verify(session).flush();//  w  w  w  . ja va  2s  .  com
    verify(session).close();
}

From source file:org.springframework.orm.hibernate3.HibernateTemplateTests.java

License:Apache License

@Test
public void testReplicateWithEntityName() throws HibernateException {
    TestBean tb = new TestBean();
    given(session.getFlushMode()).willReturn(FlushMode.AUTO);
    hibernateTemplate.replicate("myEntity", tb, ReplicationMode.LATEST_VERSION);
    verify(session).replicate("myEntity", tb, ReplicationMode.LATEST_VERSION);
    verify(session).flush();/*from  www  . ja v  a  2 s . c o  m*/
    verify(session).close();
}

From source file:org.springframework.orm.hibernate4.HibernateTemplateTests.java

License:Apache License

@Test
public void testReplicate() {
    TestBean tb = new TestBean();
    given(session.getFlushMode()).willReturn(FlushMode.AUTO);
    hibernateTemplate.replicate(tb, ReplicationMode.LATEST_VERSION);
    verify(session).replicate(tb, ReplicationMode.LATEST_VERSION);
}

From source file:org.springframework.orm.hibernate4.HibernateTemplateTests.java

License:Apache License

@Test
public void testReplicateWithEntityName() {
    TestBean tb = new TestBean();
    given(session.getFlushMode()).willReturn(FlushMode.AUTO);
    hibernateTemplate.replicate("myEntity", tb, ReplicationMode.LATEST_VERSION);
    verify(session).replicate("myEntity", tb, ReplicationMode.LATEST_VERSION);
}