Examples of GbProperty


Examples of gobo.dto.GbProperty

    for (int i = 1; i <= 5; i++) {

      GbEntity entity = new GbEntity();
      entity.setKey(KeyFactory.createKey(TEST_KIND, i));

      GbProperty property1 = new GbProperty();
      property1.setName("prop1");
      property1.setValueType(GbProperty.STRING);
      property1.setValue("prepare1_" + i);
      entity.addProperty(property1);

      GbProperty property2 = new GbProperty();
      property2.setName("prop2");
      property2.setValueType(GbProperty.LONG);
      property2.setValue(String.valueOf("10" + i));
      entity.addProperty(property2);

      list.add(entity);
    }
    return list;
View Full Code Here

Examples of gobo.dto.GbProperty

    for (int i = 1; i <= 5; i++) {

      GbEntity entity = new GbEntity();
      entity.setKey(KeyFactory.createKey(TEST_KIND, i + 3));

      GbProperty property1 = new GbProperty();
      property1.setName("prop1");
      property1.setValueType(GbProperty.STRING);
      property1.setValue("prepare2_" + i);
      entity.addProperty(property1);

      GbProperty property2 = new GbProperty();
      property2.setName("prop2");
      property2.setValueType(GbProperty.LONG);
      property2.setValue(String.valueOf("20" + i));
      entity.addProperty(property2);

      list.add(entity);
    }
    return list;
View Full Code Here

Examples of gobo.dto.GbProperty

    for (int i = 1; i <= 5; i++) {

      GbEntity entity = new GbEntity();
      entity.setKey(KeyFactory.createKey(TEST_KIND, i));

      GbProperty property1 = new GbProperty();
      property1.setName("prop3");
      property1.setValueType(GbProperty.STRING);
      property1.setValue("prepare3_" + i);
      entity.addProperty(property1);

      GbProperty property2 = new GbProperty();
      property2.setName("prop2");
      property2.setValueType(GbProperty.LONG);
      property2.setValue(String.valueOf("30" + i));
      entity.addProperty(property2);

      list.add(entity);
    }
    return list;
View Full Code Here

Examples of gobo.dto.GbProperty

    for (int i = 1; i <= 5; i++) {

      GbEntity entity = new GbEntity();
      entity.setKey(KeyFactory.createKey(TEST_KIND, i));

      GbProperty property1 = new GbProperty();
      property1.setName("prop3");
      property1.setValueType(GbProperty.STRING);
      property1.setValue("prepare4_" + i);
      entity.addProperty(property1);

      GbProperty property2 = new GbProperty();
      property2.setName("prop2");
      property2.setValueType(GbProperty.LONG);
      if (i == 3) {
        property2.setValue(null);
      } else {
        property2.setValue(String.valueOf("40" + i));
      }
      entity.addProperty(property2);

      list.add(entity);
    }
View Full Code Here

Examples of gobo.dto.GbProperty

  public static List<GbProperty> entities2() {

    List<GbProperty> propList = Lists.newArrayList();

    GbProperty prop1 = new GbProperty();
    prop1.setName("prop1");
    prop1.setValue(new String("a"));
    propList.add(prop1);

    GbProperty prop2 = new GbProperty();
    prop2.setName("prop2");
    prop2.setValue(new Long(1));
    propList.add(prop2);

    GbProperty prop3 = new GbProperty();
    prop3.setName("prop3");
    prop3.setValue(new Boolean(true));
    propList.add(prop3);
    return propList;
  }
View Full Code Here

Examples of gobo.dto.GbProperty

          FetchOptions.Builder.withOffset(0));
      List<String> propNameList = Lists.newArrayList();
      for (Entity _kind : _list) {
        if (_kind.getProperty("kind_name").equals(kind)) {
          String propName = (String) _kind.getProperty("property_name");
          GbProperty gbProperty = new GbProperty();
          gbProperty.setName(propName);

          // Different type and same name properties are returned in
          // production! and here comparing only property_name.
          if (propNameList.contains(propName) == false) {
            list.add(gbProperty);
            propNameList.add(propName);
          }
        }
      }

    } else {

      Schema schema = DatastoreUtil.getSchema();
      List<EntityProto> entityProtoList = schema.kinds();
      EntityProto targetEntity = null;
      for (EntityProto entityProto : entityProtoList) {
        String kindName = DatastoreUtil.getKind(entityProto.getKey());
        if (kind.equals(kindName)) {
          targetEntity = entityProto;
          break;
        }
      }
      if (targetEntity == null) {
        throw new RuntimeException("The specified kind has no property");
      }
      List<Property> propertys = targetEntity.propertys();
      for (Property property : propertys) {
        GbProperty gbProperty = new GbProperty();
        gbProperty.setName(property.getName());
        list.add(gbProperty);
      }

    }
    logger.fine(list.toString());
View Full Code Here

Examples of gobo.dto.GbProperty

    for (Entity entity : data) {
      GbEntity gbEntity = new GbEntity();
      gbEntity.setKey(entity.getKey());
      Set<String> propNames = entity.getProperties().keySet();
      for (String propName : propNames) {
        GbProperty gbProperty = new GbProperty();
        gbProperty.setName(propName);
        gbProperty.setValue(entity.getProperty(propName));
        gbEntity.addProperty(gbProperty);
      }
      list.add(gbEntity);
    }
View Full Code Here

Examples of gobo.dto.GbProperty

        gbEntity.setKeyString(cell.getCell().getValue());
        data.add(gbEntity);
        continue;
      }

      GbProperty gbProperty = new GbProperty();
      gbProperty.setName(columnTitle[col - 1]);
      gbProperty.setValueType(dataType[col - 1]);
      gbProperty.setValue(cell.getCell().getValue());
      gbEntity.addProperty(gbProperty);
    }
    return data;
  }
View Full Code Here

Examples of gobo.dto.GbProperty

    int numberOfRows = tableEntry.getData().getNumberOfRows();
    if (numberOfRows == 0) {
      RecordEntry newEntry = new RecordEntry();
      newEntry.addField(new Field(null, Entity.KEY_RESERVED_PROPERTY, VALUE_TYPE));
      for (int i = 0; i < properties.size(); i++) {
        GbProperty gbProperty = properties.get(i);
        String columnName = gbProperty.getName();
        newEntry.addField(new Field(null, columnName, VALUE_TYPE_NOT_SET));
      }
      URL recordFeedUrl = factory.getRecordFeedUrl(ssKey, tableId);
      ss.insert(recordFeedUrl, newEntry);
      logger.info("Inserted TypeValue row in :" + kind);
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.