Package org.hibernate.ogm

Examples of org.hibernate.ogm.OgmSession.persist()


    // given
    Singer gloria = new Singer( "Gloria" );

    // when
    session.persist( gloria );

    tx.commit();
    assertThat( gloria.getId() ).isNotNull();
    session.clear();
    tx = session.beginTransaction();
View Full Code Here


    // given
    Comedian monty = new Comedian( "Monty" );

    // when
    session.persist( monty );

    tx.commit();
    assertThat( monty.getId() ).isNotNull();
    session.clear();
    tx = session.beginTransaction();
View Full Code Here

    List<OscarWildePoem> result = query.list();
    assertThat( result ).isEmpty();

    OscarWildePoem voice = new OscarWildePoem( 4L, "Her Voice", "Oscar Wilde" );
    session.persist( voice );

    result = query.list();
    assertThat( result ).onProperty( "id" ).containsExactly( 4L );

    transaction.commit();
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.