Package org.hibernate

Examples of org.hibernate.Session.persist()


    hypothesis = new Hypothesis();
    hypothesis.setId( "6" );
    hypothesis.setPosition( 6 );
    hypothesis.setDescription( "Ne vadis." );
    session.persist( hypothesis );

    hypothesis = new Hypothesis();
    hypothesis.setId( "7" );
    hypothesis.setPosition( 7 );
    hypothesis.setDescription( "100% scientia" );
View Full Code Here


    hypothesis = new Hypothesis();
    hypothesis.setId( "7" );
    hypothesis.setPosition( 7 );
    hypothesis.setDescription( "100% scientia" );
    session.persist( hypothesis );

    hypothesis = new Hypothesis();
    hypothesis.setId( "8" );
    hypothesis.setPosition( 8 );
    hypothesis.setDescription( "100\nscientiae" );
View Full Code Here

    hypothesis = new Hypothesis();
    hypothesis.setId( "8" );
    hypothesis.setPosition( 8 );
    hypothesis.setDescription( "100\nscientiae" );
    session.persist( hypothesis );

    transaction.commit();
    session.clear();
    session.close();
  }
View Full Code Here

    final Transaction transaction = session.getTransaction();
    transaction.begin();

    Module mongodb = new Module();
    mongodb.setName( "MongoDB" );
    session.persist( mongodb );

    Module infinispan = new Module();
    infinispan.setName( "Infinispan" );
    session.persist( infinispan );
View Full Code Here

    mongodb.setName( "MongoDB" );
    session.persist( mongodb );

    Module infinispan = new Module();
    infinispan.setName( "Infinispan" );
    session.persist( infinispan );

    List<Module> modules = new ArrayList<Module>();
    modules.add( mongodb );
    modules.add( infinispan );
View Full Code Here

    Project hibernateOGM = new Project();
    hibernateOGM.setId( "projectID" );
    hibernateOGM.setName( "HibernateOGM" );
    hibernateOGM.setModules( modules );

    session.persist( hibernateOGM );
    transaction.commit();

    this.addExtraColumn();
    AssociationKeyMetadata metadata = new AssociationKeyMetadata.Builder()
        .table( "Project_Module" )
View Full Code Here

    final Session session = sessions.openSession();
    Transaction transaction = session.beginTransaction();

    // when inserting a golf player
    GolfPlayer ben = new GolfPlayer( 1L, "Ben", 0.1 );
    session.persist( ben );

    transaction.commit();
    session.close();

    // then expect one (batched) insert with the configured write concern
View Full Code Here

    Session session = sessions.openSession();
    Transaction transaction = session.beginTransaction();

    // when inserting a player with an associated course
    GolfPlayer ben = new GolfPlayer( 1L, "Ben", 0.1, new GolfCourse( 1L, "Bepple Peach" ) );
    session.persist( ben );

    transaction.commit();
    session.close();

    // then expect association operations using the configured write concern
View Full Code Here

    Session session = sessions.openSession();
    Transaction transaction = session.beginTransaction();

    // when inserting a player with an associated course
    GolfPlayer ben = new GolfPlayer( 1L, "Ben", 0.1, new GolfCourse( 1L, "Bepple Peach" ) );
    session.persist( ben );

    transaction.commit();
    session.close();

    // then expect tuple and association operations using the configured write concerns
View Full Code Here

    Transaction transaction = session.beginTransaction();

    Helicopter helicopter = new Helicopter();
    helicopter.setMake( "Lama" );
    helicopter.setName( "Sergio" );
    session.persist( helicopter );

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