当前位置: 首页>>代码示例>>Java>>正文


Java IDelete类代码示例

本文整理汇总了Java中com.taobao.tddl.optimizer.core.plan.dml.IDelete的典型用法代码示例。如果您正苦于以下问题:Java IDelete类的具体用法?Java IDelete怎么用?Java IDelete使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IDelete类属于com.taobao.tddl.optimizer.core.plan.dml包,在下文中一共展示了IDelete类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: toDataNodeExecutor

import com.taobao.tddl.optimizer.core.plan.dml.IDelete; //导入依赖的package包/类
@Override
public IPut toDataNodeExecutor(int shareIndex) {
    IDelete delete = ASTNodeFactory.getInstance().createDelete();
    delete.setConsistent(true);
    delete.executeOn(this.getNode().getDataNode());
    delete.setQueryTree((IQueryTree) this.getNode().toDataNodeExecutor());
    if (this.getNode().getActualTableName() != null) {
        delete.setTableName(this.getNode().getActualTableName());
    } else if (this.getNode() instanceof KVIndexNode) {
        delete.setTableName(((KVIndexNode) this.getNode()).getIndexName());
    } else {
        delete.setTableName(this.getNode().getTableName());
    }
    delete.setIndexName(this.getNode().getIndexUsed().getName());
    delete.setBatchIndexs(this.getBatchIndexs());

    delete.setIgnore(this.isIgnore());
    delete.setQuick(this.isQuick());
    delete.setLowPriority(this.lowPriority);
    delete.setHighPriority(this.highPriority);
    delete.setDelayed(this.isDelayed());
    delete.setMultiValues(this.isMultiValues());
    delete.setMultiValues(this.getMultiValues());
    delete.setExistSequenceVal(this.isExistSequenceVal());
    return delete;
}
 
开发者ID:loye168,项目名称:tddl5,代码行数:27,代码来源:DeleteNode.java

示例2: testDelete

import com.taobao.tddl.optimizer.core.plan.dml.IDelete; //导入依赖的package包/类
@Test
public void testDelete() {
    String sql = "DELETE FROM TABLE1 WHERE ID = ?";

    Map<Integer, ParameterContext> currentParameter = new HashMap<Integer, ParameterContext>();
    ParameterContext p1 = new ParameterContext(ParameterMethod.setObject1, new Object[] { 2 });
    currentParameter.put(1, p1);

    Parameters parameterSettings = new Parameters();
    parameterSettings.getCurrentParameter().put(1,
        new ParameterContext(ParameterMethod.setObject1, new Object[] { 1, 1 }));
    parameterSettings.addBatch();

    parameterSettings.getCurrentParameter().put(1,
        new ParameterContext(ParameterMethod.setObject1, new Object[] { 1, 2 }));
    parameterSettings.addBatch();

    IDataNodeExecutor plan = optimizer.optimizeAndAssignment(sql, parameterSettings, null, false);
    Assert.assertTrue(plan instanceof IMerge);
    Assert.assertEquals(((IDelete) ((IMerge) plan).getSubNodes().get(0)).getBatchIndexs(), Arrays.asList(0));
    Assert.assertEquals(((IDelete) ((IMerge) plan).getSubNodes().get(1)).getBatchIndexs(), Arrays.asList(1));
}
 
开发者ID:loye168,项目名称:tddl5,代码行数:23,代码来源:BatchTest.java

示例3: accept

import com.taobao.tddl.optimizer.core.plan.dml.IDelete; //导入依赖的package包/类
@Override
public void accept(PlanVisitor visitor) {
    if (this instanceof IInsert) {
        visitor.visit((IInsert) this);
    } else if (this instanceof IDelete) {
        visitor.visit((IDelete) this);
    } else if (this instanceof IUpdate) {
        visitor.visit((IUpdate) this);
    } else if (this instanceof IReplace) {
        visitor.visit((IReplace) this);
    }
}
 
开发者ID:loye168,项目名称:tddl5,代码行数:13,代码来源:Put.java

示例4: ParameterContext

import com.taobao.tddl.optimizer.core.plan.dml.IDelete; //导入依赖的package包/类
@Test
public void testDelete_范围查询() {
    String sql = "DELETE FROM TABLE1 WHERE ID > ? AND ID < ?";

    Map<Integer, ParameterContext> currentParameter = new HashMap<Integer, ParameterContext>();
    ParameterContext p1 = new ParameterContext(ParameterMethod.setObject1, new Object[] { 2 });
    currentParameter.put(1, p1);

    Parameters parameterSettings = new Parameters();
    parameterSettings.getCurrentParameter().put(1,
        new ParameterContext(ParameterMethod.setObject1, new Object[] { 1, 1 }));
    parameterSettings.getCurrentParameter().put(2,
        new ParameterContext(ParameterMethod.setObject1, new Object[] { 2, 4 }));
    parameterSettings.addBatch();

    parameterSettings.getCurrentParameter().put(1,
        new ParameterContext(ParameterMethod.setObject1, new Object[] { 1, 2 }));
    parameterSettings.getCurrentParameter().put(2,
        new ParameterContext(ParameterMethod.setObject1, new Object[] { 2, 5 }));
    parameterSettings.addBatch();

    IDataNodeExecutor plan = optimizer.optimizeAndAssignment(sql, parameterSettings, null, false);
    Assert.assertTrue(plan instanceof IMerge);
    Assert.assertEquals(((IDelete) ((IMerge) plan).getSubNodes().get(0)).getBatchIndexs(), Arrays.asList(0));
    Assert.assertEquals(((IDelete) ((IMerge) plan).getSubNodes().get(1)).getBatchIndexs(), Arrays.asList(1));
    Assert.assertEquals(((IDelete) ((IMerge) plan).getSubNodes().get(2)).getBatchIndexs(), Arrays.asList(0, 1));
}
 
开发者ID:loye168,项目名称:tddl5,代码行数:28,代码来源:BatchTest.java

示例5: IN

import com.taobao.tddl.optimizer.core.plan.dml.IDelete; //导入依赖的package包/类
@Test
public void testDelete_in查询() {
    String sql = "DELETE FROM TABLE1 WHERE ID IN (?,?)";

    Map<Integer, ParameterContext> currentParameter = new HashMap<Integer, ParameterContext>();
    ParameterContext p1 = new ParameterContext(ParameterMethod.setObject1, new Object[] { 2 });
    currentParameter.put(1, p1);

    Parameters parameterSettings = new Parameters();
    parameterSettings.getCurrentParameter().put(1,
        new ParameterContext(ParameterMethod.setObject1, new Object[] { 1, 2 }));
    parameterSettings.getCurrentParameter().put(2,
        new ParameterContext(ParameterMethod.setObject1, new Object[] { 2, 3 }));
    parameterSettings.addBatch();

    parameterSettings.getCurrentParameter().put(1,
        new ParameterContext(ParameterMethod.setObject1, new Object[] { 1, 3 }));
    parameterSettings.getCurrentParameter().put(2,
        new ParameterContext(ParameterMethod.setObject1, new Object[] { 2, 4 }));
    parameterSettings.addBatch();

    IDataNodeExecutor plan = optimizer.optimizeAndAssignment(sql, parameterSettings, null, false);
    Assert.assertTrue(plan instanceof IMerge);
    Assert.assertEquals(((IDelete) ((IMerge) plan).getSubNodes().get(0)).getBatchIndexs(), Arrays.asList(0));
    Assert.assertEquals(((IDelete) ((IMerge) plan).getSubNodes().get(1)).getBatchIndexs(), Arrays.asList(1));
    Assert.assertEquals(((IDelete) ((IMerge) plan).getSubNodes().get(2)).getBatchIndexs(), Arrays.asList(0, 1));
}
 
开发者ID:loye168,项目名称:tddl5,代码行数:28,代码来源:BatchTest.java

示例6: toDataNodeExecutor

import com.taobao.tddl.optimizer.core.plan.dml.IDelete; //导入依赖的package包/类
public IDataNodeExecutor toDataNodeExecutor() throws QueryException {
    IDelete delete = ASTNodeFactory.getInstance().createDelete();
    delete.setConsistent(true);
    delete.executeOn(this.getDataNode());
    delete.setQueryTree(this.getNode().toDataNodeExecutor());
    if (this.getNode().getActualTableName() != null) {
        delete.setTableName(this.getNode().getActualTableName());
    } else if (this.getNode() instanceof KVIndexNode) {
        delete.setTableName(((KVIndexNode) this.getNode()).getIndexName());
    } else {
        delete.setTableName(this.getNode().getTableName());
    }
    delete.setIndexName(this.getNode().getIndexUsed().getName());
    return delete;
}
 
开发者ID:beebeandwer,项目名称:TDDL,代码行数:16,代码来源:DeleteNode.java

示例7: createDelete

import com.taobao.tddl.optimizer.core.plan.dml.IDelete; //导入依赖的package包/类
public IDelete createDelete() {
    return new Delete();
}
 
开发者ID:loye168,项目名称:tddl5,代码行数:4,代码来源:ASTNodeFactory.java

示例8: setUpdateColumns

import com.taobao.tddl.optimizer.core.plan.dml.IDelete; //导入依赖的package包/类
@Override
public IDelete setUpdateColumns(List<ISelectable> columns) {
    throw new NotSupportException();
}
 
开发者ID:loye168,项目名称:tddl5,代码行数:5,代码来源:Delete.java

示例9: setUpdateValues

import com.taobao.tddl.optimizer.core.plan.dml.IDelete; //导入依赖的package包/类
@Override
public IDelete setUpdateValues(List<Object> values) {
    throw new NotSupportException();
}
 
开发者ID:loye168,项目名称:tddl5,代码行数:5,代码来源:Delete.java

示例10: copy

import com.taobao.tddl.optimizer.core.plan.dml.IDelete; //导入依赖的package包/类
@Override
public IDelete copy() {
    IDelete delete = ASTNodeFactory.getInstance().createDelete();
    copySelfTo(delete);
    return delete;
}
 
开发者ID:loye168,项目名称:tddl5,代码行数:7,代码来源:Delete.java

示例11: visit

import com.taobao.tddl.optimizer.core.plan.dml.IDelete; //导入依赖的package包/类
public abstract void visit(IDelete delete); 
开发者ID:loye168,项目名称:tddl5,代码行数:2,代码来源:PlanVisitor.java


注:本文中的com.taobao.tddl.optimizer.core.plan.dml.IDelete类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。