Package com.xiaoleilu.hutool.db

Examples of com.xiaoleilu.hutool.db.Session.beginTransaction()


    Entity entity = Entity.create(TABLE_NAME).set("字段1", "值").set("字段2", 2);
    Entity where = Entity.create(TABLE_NAME).set("条件1", "条件值");

    Session session = Session.create(ds);
    try {
      session.beginTransaction();

      // 增,生成SQL为 INSERT INTO `table_name` SET(`字段1`, `字段2`) VALUES(?,?)
      session.insert(entity);

      // 删,生成SQL为 DELETE FROM `table_name` WHERE `条件1` = ?
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.