热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

com.googlecode.objectify.Key.getKind()方法的使用及代码示例

本文整理了Java中com.googlecode.objectify.Key.getKind()方法的一些代码示例,展示了Key.getKind()

本文整理了Java中com.googlecode.objectify.Key.getKind()方法的一些代码示例,展示了Key.getKind()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Key.getKind()方法的具体详情如下:
包路径:com.googlecode.objectify.Key
类名称:Key
方法名:getKind

Key.getKind介绍

暂无

代码示例

代码示例来源:origin: objectify/objectify

@Override
public LoadType type(final Class type) {
return new LoadTypeImpl<>(this, Key.getKind(type), type);
}

代码示例来源:origin: objectify/objectify

/**
* @return the metadata for the specified class, or null if there was nothing appropriate registered
*/
@SuppressWarnings("unchecked")
public EntityMetadata getMetadata(Class clazz) {
return getMetadata(Key.getKind(clazz));
}

代码示例来源:origin: objectify/objectify

/**
* @return the metadata for a kind of entity based on its key
* @throws IllegalArgumentException if the kind has not been registered
*/
public EntityMetadata getMetadata(final Key key) throws IllegalArgumentException {
return this.registrar.getMetadataSafe(key.getKind());
}

代码示例来源:origin: objectify/objectify

/** */
public KeyMetadata(final Class

clazz, final CreateContext ctx, final Path path) {
this.factory = ctx.getFactory();
this.clazz = clazz;
findKeyFields(clazz, ctx, path);
// There must be some field marked with @Id
if (this.idMeta == null)
throw new IllegalStateException("There must be an @Id field (String, Long, or long) for " + clazz.getName());
this.kind = Key.getKind(clazz);
}

代码示例来源:origin: objectify/objectify

/**
* @return the metadata for a registered pojo, or null if there is none
*/
@SuppressWarnings("unchecked")
public KeyMetadata getMetadata(final Key key) {
final EntityMetadata em = registrar.getMetadata(key.getKind());
return em == null ? null : em.getKeyMetadata();
}

代码示例来源:origin: objectify/objectify

/**
* @param parent can be null for root keys
*/
public Key createKey(final Key parent, final Class kind, final long id) {
final com.google.cloud.datastore.Key key = createRaw(raw(parent), Key.getKind(kind), id);
return Key.create(key);
}

代码示例来源:origin: objectify/objectify

/**
* @param parent can be null for root keys
*/
public Key createKey(final Key parent, final Class kind, final String name) {
final com.google.cloud.datastore.Key key = createRaw(raw(parent), Key.getKind(kind), name);
return Key.create(key);
}

代码示例来源:origin: objectify/objectify

String kind = Key.getKind(clazz);

代码示例来源:origin: objectify/objectify

/**
*

Preallocate multiple unique ids within the namespace of the
* specified entity class. These ids can be used in concert with the normal
* automatic allocation of ids when save()ing entities with null Long id fields.


*
*

The {@code KeyRange} class is deprecated; when using this method,
* treat the return value as {@code List>}.


*
* @param clazz must be a registered entity class with a Long or long id field.
* @param num must be >= 1 and small enough we can fit a set of keys in RAM.
*/
public KeyRange allocateIds(final Class clazz, final int num) {
final String kind = Key.getKind(clazz);
final IncompleteKey incompleteKey = datastore().newKeyFactory().setKind(kind).newKey();
return allocate(incompleteKey, num);
}

代码示例来源:origin: objectify/objectify

/** Create a key with a parent and a long id */
private Key(final Key parent, final Class kindClass, final long id) {
final String kind = getKind(kindClass);
if (parent == null) {
this.raw = newKeyFactory().setKind(kind).newKey(id);
} else {
this.raw = com.google.cloud.datastore.Key.newBuilder(key(parent), kind, id).build();
}
this.parent = parent;
}

代码示例来源:origin: objectify/objectify

/** Create a key with a parent and a String name */
private Key(final Key parent, final Class kindClass, final String name) {
final String kind = getKind(kindClass);
if (parent == null) {
this.raw = newKeyFactory().setKind(kind).newKey(name);
} else {
this.raw = com.google.cloud.datastore.Key.newBuilder(key(parent), kind, name).build();
}
this.parent = parent;
}

代码示例来源:origin: objectify/objectify

/**
* Preallocate a contiguous range of unique ids within the namespace of the
* specified entity class and the parent key. These ids can be used in concert with the normal
* automatic allocation of ids when put()ing entities with null Long id fields.
*
* @param parentKeyOrEntity must be a legitimate parent for the class type. It need not
* point to an existent entity, but it must be the correct type for clazz.
* @param clazz must be a registered entity class with a Long or long id field, and
* a parent key of the correct type.
* @param num must be >= 1 and <= 1 billion
*/
public KeyRange allocateIds(final Object parentKeyOrEntity, final Class clazz, final int num) {
final Key parent = keys().anythingToKey(parentKeyOrEntity);
final String kind = Key.getKind(clazz);
final IncompleteKey incompleteKey = com.google.cloud.datastore.Key.newBuilder(parent.getRaw(), kind).build();
return allocate(incompleteKey, num);
}

代码示例来源:origin: TEAMMATES/teammates

entityType = keyOfEntityToMigrate.getKind();

代码示例来源:origin: com.googlecode.cedar-common/objectify

/**
* @return the metadata for a kind of entity based on its key
* @throws IllegalArgumentException if the kind has not been registered
*/
public EntityMetadata getMetadata(Key key)
{
return this.getMetadata(key.getKind());
}

代码示例来源:origin: com.googlecode.cedar-common/objectify

/** Create a key with a parent and a String name */
public Key(Key parent, Class kindClass, String name)
{
this.raw = KeyFactory.createKey(raw(parent), getKind(kindClass), name);
this.parent = parent;
}

代码示例来源:origin: com.googlecode.cedar-common/objectify

/** Create a key with a parent and a long id */
public Key(Key parent, Class kindClass, long id)
{
this.raw = KeyFactory.createKey(raw(parent), getKind(kindClass), id);
this.parent = parent;
}

代码示例来源:origin: com.googlecode.cedar-common/objectify

/** */
public QueryImpl(ObjectifyFactory fact, Objectify objectify, Class clazz)
{
this.factory = fact;
this.ofy = objectify;
this.actual = new com.google.appengine.api.datastore.Query(Key.getKind(clazz));

// If this is a polymorphic subclass, add an extra filter
Subclass sub = clazz.getAnnotation(Subclass.class);
if (sub != null)
{
String discriminator = sub.name().length() > 0 ? sub.name() : clazz.getSimpleName();
this.actual.addFilter(PolymorphicEntityMetadata.DISCRIMINATOR_INDEX_PROPERTY, FilterOperator.EQUAL, discriminator);
}

this.classRestriction = clazz;
}

代码示例来源:origin: com.googlecode.cedar-common/objectify

/**
* Inspects and stores the metadata for a particular entity class.
* @param clazz must be a properly-annotated Objectify entity class.
*/
public ConcreteEntityMetadata(Conversions conversions, Class clazz)
{
this.entityClass = clazz;
this.entityClassCOnstructor= TypeUtils.getNoArgConstructor(clazz);
this.kind = Key.getKind(clazz);
this.cached = clazz.getAnnotation(Cached.class);

// Recursively walk up the inheritance chain looking for @Id and @Parent fields
this.processKeyFields(clazz);
// Walk up the inheritance chain looking for @PrePersist and @PostLoad
this.processLifecycleCallbacks(clazz);

// Now figure out how to handle normal properties
this.transmog = new Transmog(conversions, clazz);

// There must be some field marked with @Id
if ((this.idField == null) && (this.nameField == null))
throw new IllegalStateException("There must be an @Id field (String, Long, or long) for " + this.entityClass.getName());
}

代码示例来源:origin: com.googlecode.cedar-common/objectify

/**
* Preallocate a contiguous range of unique ids within the namespace of the
* specified entity class. These ids can be used in concert with the normal
* automatic allocation of ids when put()ing entities with null Long id fields.
*
* @param clazz must be a registered entity class with a Long or long id field.
* @param num must be >= 1 and <= 1 billion
*/
public KeyRange allocateIds(Class clazz, long num)
{
// Feels a little weird going directly to the DatastoreServiceFactory but the
// allocateIds() method really is optionless.
String kind = Key.getKind(clazz);
return new KeyRange(DatastoreServiceFactory.getDatastoreService().allocateIds(kind, num));
}

代码示例来源:origin: com.googlecode.cedar-common/objectify

/**
* Preallocate a contiguous range of unique ids within the namespace of the
* specified entity class and the parent key. These ids can be used in concert with the normal
* automatic allocation of ids when put()ing entities with null Long id fields.
*
* @param parentKeyOrEntity must be a legitimate parent for the class type. It need not
* point to an existent entity, but it must be the correct type for clazz.
* @param clazz must be a registered entity class with a Long or long id field, and
* a parent key of the correct type.
* @param num must be >= 1 and <= 1 billion
*/
public KeyRange allocateIds(Object parentKeyOrEntity, Class clazz, long num)
{
Key parent = this.getKey(parentKeyOrEntity);
String kind = Key.getKind(clazz);

// Feels a little weird going directly to the DatastoreServiceFactory but the
// allocateIds() method really is optionless.
return new KeyRange(DatastoreServiceFactory.getDatastoreService().allocateIds(parent.getRaw(), kind, num));
}

推荐阅读
  • 向QTextEdit拖放文件的方法及实现步骤
    本文介绍了在使用QTextEdit时如何实现拖放文件的功能,包括相关的方法和实现步骤。通过重写dragEnterEvent和dropEvent函数,并结合QMimeData和QUrl等类,可以轻松实现向QTextEdit拖放文件的功能。详细的代码实现和说明可以参考本文提供的示例代码。 ... [详细]
  • Iamtryingtomakeaclassthatwillreadatextfileofnamesintoanarray,thenreturnthatarra ... [详细]
  • 在Android开发中,使用Picasso库可以实现对网络图片的等比例缩放。本文介绍了使用Picasso库进行图片缩放的方法,并提供了具体的代码实现。通过获取图片的宽高,计算目标宽度和高度,并创建新图实现等比例缩放。 ... [详细]
  • 本文分享了一个关于在C#中使用异步代码的问题,作者在控制台中运行时代码正常工作,但在Windows窗体中却无法正常工作。作者尝试搜索局域网上的主机,但在窗体中计数器没有减少。文章提供了相关的代码和解决思路。 ... [详细]
  • Linux重启网络命令实例及关机和重启示例教程
    本文介绍了Linux系统中重启网络命令的实例,以及使用不同方式关机和重启系统的示例教程。包括使用图形界面和控制台访问系统的方法,以及使用shutdown命令进行系统关机和重启的句法和用法。 ... [详细]
  • 本文讨论了一个关于cuowu类的问题,作者在使用cuowu类时遇到了错误提示和使用AdjustmentListener的问题。文章提供了16个解决方案,并给出了两个可能导致错误的原因。 ... [详细]
  • XML介绍与使用的概述及标签规则
    本文介绍了XML的基本概念和用途,包括XML的可扩展性和标签的自定义特性。同时还详细解释了XML标签的规则,包括标签的尖括号和合法标识符的组成,标签必须成对出现的原则以及特殊标签的使用方法。通过本文的阅读,读者可以对XML的基本知识有一个全面的了解。 ... [详细]
  • 利用Visual Basic开发SAP接口程序初探的方法与原理
    本文介绍了利用Visual Basic开发SAP接口程序的方法与原理,以及SAP R/3系统的特点和二次开发平台ABAP的使用。通过程序接口自动读取SAP R/3的数据表或视图,在外部进行处理和利用水晶报表等工具生成符合中国人习惯的报表样式。具体介绍了RFC调用的原理和模型,并强调本文主要不讨论SAP R/3函数的开发,而是针对使用SAP的公司的非ABAP开发人员提供了初步的接口程序开发指导。 ... [详细]
  • 本文由编程笔记#小编为大家整理,主要介绍了logistic回归(线性和非线性)相关的知识,包括线性logistic回归的代码和数据集的分布情况。希望对你有一定的参考价值。 ... [详细]
  • Spring源码解密之默认标签的解析方式分析
    本文分析了Spring源码解密中默认标签的解析方式。通过对命名空间的判断,区分默认命名空间和自定义命名空间,并采用不同的解析方式。其中,bean标签的解析最为复杂和重要。 ... [详细]
  • android listview OnItemClickListener失效原因
    最近在做listview时发现OnItemClickListener失效的问题,经过查找发现是因为button的原因。不仅listitem中存在button会影响OnItemClickListener事件的失效,还会导致单击后listview每个item的背景改变,使得item中的所有有关焦点的事件都失效。本文给出了一个范例来说明这种情况,并提供了解决方法。 ... [详细]
  • 原文地址:https:www.cnblogs.combaoyipSpringBoot_YML.html1.在springboot中,有两种配置文件,一种 ... [详细]
  • Spring特性实现接口多类的动态调用详解
    本文详细介绍了如何使用Spring特性实现接口多类的动态调用。通过对Spring IoC容器的基础类BeanFactory和ApplicationContext的介绍,以及getBeansOfType方法的应用,解决了在实际工作中遇到的接口及多个实现类的问题。同时,文章还提到了SPI使用的不便之处,并介绍了借助ApplicationContext实现需求的方法。阅读本文,你将了解到Spring特性的实现原理和实际应用方式。 ... [详细]
  • Python正则表达式学习记录及常用方法
    本文记录了学习Python正则表达式的过程,介绍了re模块的常用方法re.search,并解释了rawstring的作用。正则表达式是一种方便检查字符串匹配模式的工具,通过本文的学习可以掌握Python中使用正则表达式的基本方法。 ... [详细]
  • 本文详细介绍了Java中vector的使用方法和相关知识,包括vector类的功能、构造方法和使用注意事项。通过使用vector类,可以方便地实现动态数组的功能,并且可以随意插入不同类型的对象,进行查找、插入和删除操作。这篇文章对于需要频繁进行查找、插入和删除操作的情况下,使用vector类是一个很好的选择。 ... [详细]
author-avatar
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有