方式一

      通过主键删除:

testService.delete("uuid"); // DELETE FROM T_TEST WHERE ID = 'uuid';

方式二

      通过对象主键删除:

Test test = new Test();

test.setId("uuid");

testService.delete(test); // DELETE FROM T_TEST WHERE ID = 'uuid';

方式三

      通过表达式删除:

testService.deletes(

  new Express(Test.T_TYPE, 1, ExpressionType.CDT_Equal),

  new Express(Test.T_NAME, "abc", ExpressionType.CDT_Equal)); 

// DELETE FROM T_TEST WHERE TYPE= 1 AND NAME= 'abc' ;

 

方式四:

    通过Terms,构建更复杂的条件删除,暂时不支持构建关联表删除:

testService.deletes(new Terms().or().and().orAnd()...);

 

目录
Copyright © objectsql.com 2021 闽ICP备17009107号-3

闽公网安备 35020302035600号