本文整理了Java中com.googlecode.objectify.Key.getKind()
方法的一些代码示例,展示了Key.getKind()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Key.getKind()
方法的具体详情如下:
包路径:com.googlecode.objectify.Key
类名称:Key
方法名:getKind
暂无
代码示例来源:origin: objectify/objectify
@Override
public
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
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
return this.registrar.getMetadataSafe(key.getKind());
}
代码示例来源:origin: objectify/objectify
clazz, final CreateContext ctx, final Path path) {/** */
public KeyMetadata(final Class
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
final EntityMetadata
return em == null ? null : em.getKeyMetadata();
}
代码示例来源:origin: objectify/objectify
/**
* @param parent can be null for root keys
*/
public
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
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 The {@code KeyRange>} class is deprecated; when using this method,/**
*
* 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.
*
*
* 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
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 extends T> 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 extends T> 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
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
{
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 extends T> 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 extends T> 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
{
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
{
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
// 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
{
// Feels a little weird going directly to the DatastoreServiceFactory but the
// allocateIds() method really is optionless.
String kind = Key.getKind(clazz);
return new KeyRange
}
代码示例来源: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
{
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
}