Search in sources :

Example 21 with TableMate

use of com.wplatform.ddal.dbobject.table.TableMate in project jdbc-shards by wplatform.

the class TruncateTableExecutor method executeUpdate.

@Override
public int executeUpdate() {
    TableMate table = castTableMate(prepared.getTable());
    session.commit(true);
    session.getUser().checkRight(table, Right.DELETE);
    TableNode[] nodes = table.getPartitionNode();
    execute(nodes);
    return 0;
}
Also used : TableNode(com.wplatform.ddal.dispatch.rule.TableNode) TableMate(com.wplatform.ddal.dbobject.table.TableMate)

Example 22 with TableMate

use of com.wplatform.ddal.dbobject.table.TableMate in project jdbc-shards by wplatform.

the class MergeExecutor method doTranslate.

@Override
protected List<Value> doTranslate(TableNode node, SearchRow row, StatementBuilder buff) {
    String forTable = node.getCompositeObjectName();
    TableMate table = castTableMate(prepared.getTable());
    Column[] columns = table.getColumns();
    return buildInsert(forTable, columns, row, buff);
}
Also used : Column(com.wplatform.ddal.dbobject.table.Column) TableMate(com.wplatform.ddal.dbobject.table.TableMate)

Aggregations

TableMate (com.wplatform.ddal.dbobject.table.TableMate)22 Column (com.wplatform.ddal.dbobject.table.Column)12 DbException (com.wplatform.ddal.message.DbException)8 TableNode (com.wplatform.ddal.dispatch.rule.TableNode)7 Value (com.wplatform.ddal.value.Value)6 Row (com.wplatform.ddal.result.Row)5 SearchRow (com.wplatform.ddal.result.SearchRow)5 Query (com.wplatform.ddal.command.dml.Query)4 Expression (com.wplatform.ddal.command.expression.Expression)4 AlterTableAddConstraint (com.wplatform.ddal.command.ddl.AlterTableAddConstraint)3 Table (com.wplatform.ddal.dbobject.table.Table)3 ResultInterface (com.wplatform.ddal.result.ResultInterface)3 Map (java.util.Map)3 DefineCommand (com.wplatform.ddal.command.ddl.DefineCommand)2 Schema (com.wplatform.ddal.dbobject.schema.Schema)2 IndexColumn (com.wplatform.ddal.dbobject.table.IndexColumn)2 TableFilter (com.wplatform.ddal.dbobject.table.TableFilter)2 Prepared (com.wplatform.ddal.command.Prepared)1 AlterTableAlterColumn (com.wplatform.ddal.command.ddl.AlterTableAlterColumn)1 CreateIndex (com.wplatform.ddal.command.ddl.CreateIndex)1