Package jodd.db

Examples of jodd.db.DbQuery.autoClose()


  /**
   * Simply inserts object into the database.
   */
  public void save(Object entity) {
    DbQuery q = query(insert(entity));
    q.autoClose().executeUpdate();
  }

  /**
   * Inserts bunch of objects into the database.
   * @see #save(Object)
View Full Code Here


    assertEquals(2, dq.executeCount());

    //dq.reset();
    dq.setInteger("id", 10);
    assertEquals(1, session.getTotalQueries());
    assertEquals(0, dq.autoClose().executeCount());

    assertEquals(0, session.getTotalQueries());


    // ---------------------------------------------------------------- girl
View Full Code Here

        "TIME timestamp not null default CURRENT_TIMESTAMP, " +
        "primary key (ID)" +
        ')';

    DbQuery query = new DbQuery(sql);
    query.autoClose().executeUpdate();
    assertTrue(query.isClosed());

    executeUpdate(session, "insert into GIRL(ID, NAME, SPECIALITY) values(1, 'Anna', 'swim')");
    executeUpdate(session, "insert into GIRL(ID, NAME, SPECIALITY) values(2, 'Sandra', 'piano')");
    executeUpdate(session, "insert into GIRL(NAME) values('Monica')");
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.