Examples of UpdateAction


Examples of com.alibaba.wasp.plan.action.UpdateAction

    String tableName = "test";
    String primary = "1234";
    String familyName = "info";
    String columnName = "col";
    String value = "8899";
    UpdateAction action = new UpdateAction(tableName, Bytes.toBytes(primary));
    action.addEntityColumn(tableName, familyName, columnName, DataType.STRING,
        Bytes.toBytes(value));
    MessageProto message = ProtobufUtil.convertUpdateAction(action);
    action = (UpdateAction) ProtobufUtil.convertWriteAction(message);
    Assert.assertTrue(tableName.equals(action.getFTableName()));
    Assert.assertTrue(primary.equals(Bytes.toString(action.getCombinedPrimaryKey())));
    Assert.assertTrue(action.getColumns().get(0).getFamilyName()
        .equals(familyName)
        && action.getColumns().get(0).getColumnName().equals(columnName)
        && Bytes.toString(action.getColumns().get(0).getValue()).equals(value));
  }
View Full Code Here

Examples of com.alibaba.wasp.plan.action.UpdateAction

      throw new IOException("Not match primary key.");
    }

    byte[] primayKey = RowBuilder.build().genRowkey(primaryKeyPairs);

    UpdateAction action = new UpdateAction(fTableName, primayKey);
    // Parse Update Item
    List<SQLUpdateSetItem> updateItems = sqlUpdateStatement.getItems();
    for (SQLUpdateSetItem updateItem : updateItems) {
      String columnName = parseColumn(updateItem.getColumn());
      // check this FTable has the column and not pk
      metaEventOperation.checkFieldNotInPrimaryKeys(table, columnName);
      Field field = table.getColumn(columnName);
      // Check the input is the same as DataType
      checkType(field, updateItem.getValue());
      byte[] value = convert(field, updateItem.getValue());
      String familyName = metaEventOperation.getColumnFamily(fTableName,
          columnName);
      action.addEntityColumn(fTableName, familyName, columnName,
          field.getType(), value);
    }
    if (context.isGenWholePlan()) {
      Condition entityGroupKeyCondition = ParserUtils.getCondition(table
          .getEntityGroupKey().getName(), conditions);
      // Get entityGroupLocation according to entity group key
      EntityGroupLocation entityGroupLocation = this.connection
          .locateEntityGroup(Bytes.toBytes(table.getTableName()), DruidParser
              .convert(table.getColumn(entityGroupKeyCondition.getFieldName()),
                  entityGroupKeyCondition.getValue()));
      action.setEntityGroupLocation(entityGroupLocation);
    }
    action.setSessionId(context.getSessionId());
    List<UpdateAction> actions = new ArrayList<UpdateAction>();
    actions.add(action);
    UpdatePlan plan = new UpdatePlan(actions);
    context.setPlan(plan);
    LOG.debug("UpdatePlan " + plan);
View Full Code Here

Examples of com.alibaba.wasp.plan.action.UpdateAction

      throws ServiceException {
    List<ClientProtos.WriteResultProto> writeResultProtos = new ArrayList<ClientProtos.WriteResultProto>();
    List<UpdateAction> updateActions = plan.getActions();
    // if actions > 1. will commit by 2pc
    if (updateActions.size() == 1) {
      UpdateAction action = updateActions.get(0);
      EntityGroupInfo entityGroupInfo = action.getEntityGroupLocation()
          .getEntityGroupInfo();
      ServerName serverName = new ServerName(action.getEntityGroupLocation()
          .getHostname(), action.getEntityGroupLocation().getPort(),
          ServerName.NON_STARTCODE);
      try {
        if (workingOnLocalServer(server, serverName)) {
          ClientProtos.UpdateResponse response = server.update(
              entityGroupInfo.getEntityGroupName(), action);
View Full Code Here

Examples of com.dubture.composer.ui.actions.UpdateAction

    return updateAction;
  }
 
  protected IAction getUpdateNoDevAction() {
    if (updateNoDevAction == null) {
      updateNoDevAction = new UpdateAction(project, getSite());
    }
   
    return updateNoDevAction;
  }
View Full Code Here

Examples of org.apache.cayenne.access.jdbc.UpdateAction

    public SQLAction updateAction(Query query) {
        if (query instanceof SQLTemplate) {
            return new SQLTemplateAction((SQLTemplate) query, adapter, entityResolver);
        }

        return new UpdateAction(query, adapter, entityResolver);
    }
View Full Code Here

Examples of org.apache.cayenne.access.jdbc.UpdateAction

    public SQLAction updateAction(Query query) {
        if (query instanceof SQLTemplate) {
            return new SQLTemplateAction((SQLTemplate) query, adapter, entityResolver);
        }

        return new UpdateAction(query, adapter, entityResolver);
    }
View Full Code Here

Examples of org.apache.cayenne.access.jdbc.UpdateAction

    public SQLAction updateAction(Query query) {
        if (query instanceof SQLTemplate) {
            return new SQLTemplateAction((SQLTemplate) query, adapter);
        }

        return new UpdateAction(query, adapter, entityResolver);
    }
View Full Code Here

Examples of org.apache.cayenne.access.jdbc.UpdateAction

     * @deprecated since 1.2
     */
    protected void runUpdate(Connection con, Query query, OperationObserver delegate)
            throws SQLException, Exception {

        new UpdateAction(query, getAdapter(), getEntityResolver()).performAction(
                con,
                delegate);
    }
View Full Code Here

Examples of org.apache.cayenne.access.jdbc.UpdateAction

    public SQLAction updateAction(Query query) {
        if (query instanceof SQLTemplate) {
            return new SQLTemplateAction((SQLTemplate) query, adapter);
        }

        return new UpdateAction(query, adapter, entityResolver);
    }
View Full Code Here

Examples of org.apache.cayenne.access.jdbc.UpdateAction

    public SQLAction updateAction(Query query) {
        if (query instanceof SQLTemplate) {
            return new SQLTemplateAction((SQLTemplate) query, adapter);
        }

        return new UpdateAction(query, adapter, entityResolver);
    }
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.