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


Java Entity.setUnindexedProperty方法代码示例

本文整理汇总了Java中com.google.appengine.api.datastore.Entity.setUnindexedProperty方法的典型用法代码示例。如果您正苦于以下问题:Java Entity.setUnindexedProperty方法的具体用法?Java Entity.setUnindexedProperty怎么用?Java Entity.setUnindexedProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.appengine.api.datastore.Entity的用法示例。


在下文中一共展示了Entity.setUnindexedProperty方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: saveFile

import com.google.appengine.api.datastore.Entity; //导入方法依赖的package包/类
/**
 * Save Full File
 *
 * @param inputStream
 */
private static void saveFile(InputStream inputStream) {
    DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
    Calendar time = Calendar.getInstance(TimeZone.getTimeZone("CET"));
    time.set(Calendar.HOUR_OF_DAY,0);
    time.set(Calendar.MINUTE,0);
    time.set(Calendar.SECOND,0);
    Date measuredAt = time.getTime();
    long millis = time.getTimeInMillis();
    //
    Entity entity = new Entity(ENTITY_TYPE_FICHEROS,millis);
    entity.setIndexedProperty("Date", measuredAt);
    entity.setUnindexedProperty("File", GlobalUtils.getString(inputStream));
    // Store
    datastore.put(entity);
}
 
开发者ID:medialab-prado,项目名称:puremadrid,代码行数:21,代码来源:GetNewData.java

示例2: setOrRemoveUnindexedProperty

import com.google.appengine.api.datastore.Entity; //导入方法依赖的package包/类
public static void setOrRemoveUnindexedProperty(
    Entity e, String propertyName, @Nullable Object value) {
  Preconditions.checkNotNull(e, "Null entity");
  Preconditions.checkNotNull(propertyName, "Null propertyName");
  if (value == null) {
    e.removeProperty(propertyName);
  } else {
    e.setUnindexedProperty(propertyName, value);
  }
}
 
开发者ID:ArloJamesBarnes,项目名称:walkaround,代码行数:11,代码来源:DatastoreUtil.java

示例3: saveToDataStore

import com.google.appengine.api.datastore.Entity; //导入方法依赖的package包/类
private void saveToDataStore(List<Medicion> mediciones) {
    mLogger.info("Storing " + mediciones.size() + " hours");

    // Saved date
    Date savedDate = Calendar.getInstance(TimeZone.getTimeZone("CET")).getTime();

    // Load datastore
    List<Entity> batch = new ArrayList<>();
    for (Medicion medicion : mediciones){
        // Measured date
        long measuredAtMillis = medicion.getMeasuredAt();
        Date measuredAt = new Date();
        Calendar measuredAtCalendar = Calendar.getInstance(TimeZone.getTimeZone("CET"));
        measuredAtCalendar.setTimeInMillis(measuredAtMillis);
        measuredAt.setTime(measuredAtMillis);
        //
        long savedAtMillis = medicion.getSavedAtHour();
        Date savedAt = new Date();
        savedAt.setTime(savedAtMillis);

        // Una entidad por cada compuesto
        for (Compuesto compuesto: Compuesto.measuredCompuestos()) {
            // Build entity
            Entity entity = new Entity(ENTITY_TYPE_MEDIDAS, measuredAt.getTime() + compuesto.getId());
            entity.setIndexedProperty(PROPERTY_COMPUESTO, compuesto.name());
            entity.setIndexedProperty(PROPERTY_AVISO, medicion.getAviso());
            entity.setIndexedProperty(PROPERTY_AVISO_STATE, medicion.getAvisoState());
            entity.setIndexedProperty(PREPERTY_AVISO_MAX_TODAY, medicion.getAvisoMaxToday());
            entity.setIndexedProperty(PROPERTY_ESCENARIO_STATE_TODAY, medicion.getEscenarioStateToday());
            entity.setIndexedProperty(PROPERTY_ESCENARIO_STATE_TOMORROW, medicion.getEscenarioStateTomorrow());
            entity.setIndexedProperty(PROPERTY_ESCENARIO_STATE_TOMORROW_MANUAL, medicion.getEscenarioManualTomorrow());
            entity.setIndexedProperty(PROPERTY_SAVED_AT, savedDate);
            entity.setIndexedProperty(PROPERTY_MEASURE_DATE, measuredAt);
            entity.setIndexedProperty(PROPERTY_MEASURE_TIME, stringHour(measuredAtCalendar.get(Calendar.HOUR_OF_DAY)));
            // Build stations
            Map<String, Object> valueMap = medicion.getCompuestoValues(compuesto);
            if (valueMap != null) {
                for (Map.Entry<String, Object> entry : valueMap.entrySet()) {
                    entity.setUnindexedProperty(entry.getKey(), entry.getValue());
                }
            }
            // Store
            batch.add(entity);
        }
    }
    DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
    datastore.put(batch);

}
 
开发者ID:medialab-prado,项目名称:puremadrid,代码行数:50,代码来源:GetNewData.java

示例4: setNonNullUnindexedProperty

import com.google.appengine.api.datastore.Entity; //导入方法依赖的package包/类
public static void setNonNullUnindexedProperty(Entity e, String propertyName, Object value) {
  Preconditions.checkNotNull(e, "Null entity");
  Preconditions.checkNotNull(propertyName, "Null propertyName");
  Preconditions.checkNotNull(value, "Null value");
  e.setUnindexedProperty(propertyName, value);
}
 
开发者ID:ArloJamesBarnes,项目名称:walkaround,代码行数:7,代码来源:DatastoreUtil.java


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