Package org.hibernate.classic

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


      pickup.setVin( "123p" );
      pickup.setOwner( "Cecelia" );
      s.save( pickup );

      BooleanLiteralEntity bool = new BooleanLiteralEntity();
      s.save( bool );

      txn.commit();
      s.close();
    }
View Full Code Here


  public void testIncrementTimestampVersion() {
    Session s = openSession();
    Transaction t = s.beginTransaction();

    TimestampVersioned entity = new TimestampVersioned( "ts-vers" );
    s.save( entity );
    t.commit();
    s.close();

    Date initialVersion = entity.getVersion();
View Full Code Here

    Transaction t = s.beginTransaction();

    Human human = new Human();
    human.setName( new Name( "Stevee", 'X', "Ebersole" ) );

    s.save( human );
    s.flush();

    t.commit();

    String correctName = "Steve";
View Full Code Here

    Human mother = new Human();
    mother.setName( new Name( "Jane", 'E', null ) );
    human.setMother( mother );

    s.save( human );
    s.save( mother );
    s.flush();

    t.commit();
View Full Code Here

    Human mother = new Human();
    mother.setName( new Name( "Jane", 'E', null ) );
    human.setMother( mother );

    s.save( human );
    s.save( mother );
    s.flush();

    t.commit();

    t = s.beginTransaction();
View Full Code Here

    s.beginTransaction();
    SimpleEntityWithAssociation owner = new SimpleEntityWithAssociation( "myEntity-1" );
    owner.addAssociation( "assoc-1" );
    owner.addAssociation( "assoc-2" );
    owner.addAssociation( "assoc-3" );
    s.save( owner );
    SimpleEntityWithAssociation owner2 = new SimpleEntityWithAssociation( "myEntity-2" );
    owner2.addAssociation( "assoc-1" );
    owner2.addAssociation( "assoc-2" );
    owner2.addAssociation( "assoc-3" );
    owner2.addAssociation( "assoc-4" );
View Full Code Here

    SimpleEntityWithAssociation owner2 = new SimpleEntityWithAssociation( "myEntity-2" );
    owner2.addAssociation( "assoc-1" );
    owner2.addAssociation( "assoc-2" );
    owner2.addAssociation( "assoc-3" );
    owner2.addAssociation( "assoc-4" );
    s.save( owner2 );
    SimpleEntityWithAssociation owner3 = new SimpleEntityWithAssociation( "myEntity-3" );
    s.save( owner3 );
    s.getTransaction().commit();
    s.close();
View Full Code Here

    owner2.addAssociation( "assoc-2" );
    owner2.addAssociation( "assoc-3" );
    owner2.addAssociation( "assoc-4" );
    s.save( owner2 );
    SimpleEntityWithAssociation owner3 = new SimpleEntityWithAssociation( "myEntity-3" );
    s.save( owner3 );
    s.getTransaction().commit();
    s.close();

    // now try the bulk delete
    s = openSession();
View Full Code Here

              historyMessage = sourceWorkspace + ";;" + destinationWorkspace
                      + historyComments;
            }
          }
          historyEntry.setMessage(historyMessage);
          session.save(historyEntry);
                  session.flush();
          insertedCount++;
                    latestTimeProcessed = date.getTime();
                    lastUUIDProcessed = nodeIdentifier;
                    lastPropertyProcessed = propertyName;
View Full Code Here

    s.beginTransaction();

    Truck truck = new Truck();
    truck.setVin( "123t" );
    truck.setOwner( "Steve" );
    s.save( truck );

    // manually flush the session to ensure the insert happens
    s.flush();

    // now issue a bulk delete against Car which should force the temp table to be
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.