Package com.google.gdata.client.spreadsheet

Examples of com.google.gdata.client.spreadsheet.RecordQuery


    FeedURLFactory factory = FeedURLFactory.getDefault();
    URL recordFeedUrl = factory.getRecordFeedUrl(ssKey, tableId);

    // Get "valueType" row for update.
    logger.info("Checking valueType row in :" + kind);
    RecordQuery query = new RecordQuery(recordFeedUrl);
    query.setSpreadsheetQuery(Entity.KEY_RESERVED_PROPERTY + "=" + VALUE_TYPE);
    RecordEntry valueTypeRow = ss.query(query, RecordFeed.class).getEntries().get(0);
    Map<String, Field> valueTypeRowMap = new HashMap<String, Field>();
    boolean valueTypeNotSet = false;
    for (Field field : valueTypeRow.getFields()) {
      valueTypeRowMap.put(field.getName(), field);
      if (field.getValue().equals(VALUE_TYPE_NOT_SET)) {
        valueTypeNotSet = true;
      }
    }

    // When retrying, Check if already exists
    List<String> duplicateCheckList = new ArrayList<String>();
    if (retry) {
      /*
       * If you use query like setSpreadsheetQuery("__key__=Kind(1)"),
       * '()' in __key__ conflicts with '()' as parameter...
       */
      RecordQuery query2 = new RecordQuery(recordFeedUrl);
      query2.setMaxResults(list.size());
      query2.setReverse(true);
      final List<RecordEntry> entries = ss.query(query2, RecordFeed.class).getEntries();
      for (RecordEntry entry : entries) {
        for (Field field : entry.getFields()) {
          if (field.getName().equals(Entity.KEY_RESERVED_PROPERTY)) {
            duplicateCheckList.add(field.getValue());
View Full Code Here

TOP

Related Classes of com.google.gdata.client.spreadsheet.RecordQuery

Copyright © 2018 www.massapicom. 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.