本文整理了Java中com.google.cloud.datastore.Datastore.getOptions()
方法的一些代码示例,展示了Datastore.getOptions()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Datastore.getOptions()
方法的具体详情如下:
包路径:com.google.cloud.datastore.Datastore
类名称:Datastore
方法名:getOptions
暂无
代码示例来源:origin: googleapis/google-cloud-java
@Test
public void testGetOptions() {
assertSame(options, datastore.getOptions());
}
代码示例来源:origin: googleapis/google-cloud-java
Entity entity5 = Entity.newBuilder(KEY5).set("value", "value").build();
datastore.add(ENTITY3, entity4, entity5);
DatastoreRpc datastoreRpc = datastore.getOptions().getDatastoreRpcV1();
List<RunQueryResponse> responses = new ArrayList<>();
Query<Entity> query = Query.newEntityQueryBuilder().build();
代码示例来源:origin: spotify/styx
@Override
public DatastoreOptions getOptions() {
return delegate.getOptions();
}
代码示例来源:origin: sai-pullabhotla/catatumbo
/**
* Returns the effective namespace. If a namespace was specified using {@link Tenant}, it will be
* returned. Otherwise, the namespace of this EntityManager is returned.
*
* @return the effective namespace.
*/
String getEffectiveNamespace() {
String namespace = Tenant.getNamespace();
if (namespace == null) {
namespace = datastore.getOptions().getNamespace();
}
return namespace;
}
代码示例来源:origin: sai-pullabhotla/catatumbo
/**
* Returns an IncompleteKey of the given entity.
*
* @param entity
* the entity
* @return the incomplete key
*/
private IncompleteKey getIncompleteKey(Object entity) {
EntityMetadata entityMetadata = EntityIntrospector.introspect(entity.getClass());
String kind = entityMetadata.getKind();
ParentKeyMetadata parentKeyMetadata = entityMetadata.getParentKeyMetadata();
DatastoreKey parentKey = null;
IncompleteKey incompleteKey = null;
if (parentKeyMetadata != null) {
parentKey = (DatastoreKey) IntrospectionUtils.getFieldValue(parentKeyMetadata, entity);
}
if (parentKey != null) {
incompleteKey = IncompleteKey.newBuilder(parentKey.nativeKey(), kind).build();
} else {
incompleteKey = IncompleteKey.newBuilder(datastore.getOptions().getProjectId(), kind)
.setNamespace(getEffectiveNamespace()).build();
}
return incompleteKey;
}
内容来源于网络,如有侵权,请联系作者删除!