Package org.hibernate.classic

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


    assertEquals( "Incorrect deletion count on joined subclass", 1, count );

    count = s.createQuery( "delete Mammal" ).executeUpdate();
    assertEquals( "Incorrect deletion count on joined subclass", 1, count );

    count = s.createQuery( "delete SubMulti" ).executeUpdate();
    assertEquals( "Incorrect deletion count on joined subclass", 0, count );

    t.commit();
    s.close();
View Full Code Here


    data.prepare();

    Session s = openSession();
    Transaction t = s.beginTransaction();

    int count = s.createQuery( "delete Joiner where joinedName = :joinedName" ).setString( "joinedName", "joined-name" ).executeUpdate();
    assertEquals( "Incorrect deletion count on joined subclass", 1, count );

    t.commit();
    s.close();
View Full Code Here

    // These should reach out into *all* subclass tables...
    Session s = openSession();
    Transaction t = s.beginTransaction();

    int count = s.createQuery( "delete Vehicle where owner = :owner" ).setString( "owner", "Steve" ).executeUpdate();
    assertEquals( "incorrect restricted update count", 1, count );

    count = s.createQuery( "delete Vehicle" ).executeUpdate();
    assertEquals( "incorrect update count", 3, count );
    t.commit();
View Full Code Here

    Transaction t = s.beginTransaction();

    int count = s.createQuery( "delete Vehicle where owner = :owner" ).setString( "owner", "Steve" ).executeUpdate();
    assertEquals( "incorrect restricted update count", 1, count );

    count = s.createQuery( "delete Vehicle" ).executeUpdate();
    assertEquals( "incorrect update count", 3, count );
    t.commit();
    s.close();

    data.cleanup();
View Full Code Here

    // These should only affect the given table
    Session s = openSession();
    Transaction t = s.beginTransaction();

    int count = s.createQuery( "delete Truck where owner = :owner" ).setString( "owner", "Steve" ).executeUpdate();
    assertEquals( "incorrect restricted update count", 1, count );

    count = s.createQuery( "delete Truck" ).executeUpdate();
    assertEquals( "incorrect update count", 2, count );
    t.commit();
View Full Code Here

    Transaction t = s.beginTransaction();

    int count = s.createQuery( "delete Truck where owner = :owner" ).setString( "owner", "Steve" ).executeUpdate();
    assertEquals( "incorrect restricted update count", 1, count );

    count = s.createQuery( "delete Truck" ).executeUpdate();
    assertEquals( "incorrect update count", 2, count );
    t.commit();
    s.close();

    data.cleanup();
View Full Code Here

    // These should only affect the given table
    Session s = openSession();
    Transaction t = s.beginTransaction();

    int count = s.createQuery( "delete Car where owner = :owner" ).setString( "owner", "Kirsten" ).executeUpdate();
    assertEquals( "incorrect restricted update count", 1, count );

    count = s.createQuery( "delete Car" ).executeUpdate();
    assertEquals( "incorrect update count", 0, count );
    t.commit();
View Full Code Here

    Transaction t = s.beginTransaction();

    int count = s.createQuery( "delete Car where owner = :owner" ).setString( "owner", "Kirsten" ).executeUpdate();
    assertEquals( "incorrect restricted update count", 1, count );

    count = s.createQuery( "delete Car" ).executeUpdate();
    assertEquals( "incorrect update count", 0, count );
    t.commit();
    s.close();

    data.cleanup();
View Full Code Here

  public void testDeleteWithMetadataWhereFragments() throws Throwable {
    Session s = openSession();
    Transaction t = s.beginTransaction();

    // Note: we are just checking the syntax here...
    s.createQuery("delete from Bar").executeUpdate();
    s.createQuery("delete from Bar where barString = 's'").executeUpdate();

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

    Session s = openSession();
    Transaction t = s.beginTransaction();

    // Note: we are just checking the syntax here...
    s.createQuery("delete from Bar").executeUpdate();
    s.createQuery("delete from Bar where barString = 's'").executeUpdate();

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