public class Key<T> extends Object implements Serializable, Comparable<Key<T>>
The key object; this class is take from the app-engine datastore (mostly) implementation. It is also Serializable and GWT-safe, enabling your entity objects to be used for GWT RPC should you so desire.
You may use normal DBRef objects as relationships in your entities if you desire neither type safety nor GWT-ability.
Constructor and Description |
---|
Key(Class<? extends T> type,
String collection,
byte[] idBytes)
Create a key with an id
|
Key(Class<? extends T> type,
String collection,
Object id)
Create a key with an id
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Key<T> other)
Compares based on the following traits, in order:
|
boolean |
equals(Object obj) |
String |
getCollection() |
Object |
getId() |
Class<? extends T> |
getType() |
int |
hashCode() |
void |
setCollection(String collection)
sets the collection-name.
|
void |
setType(Class<? extends T> clazz) |
String |
toString()
Creates a human-readable version of this key
|
public Object getId()
public String getCollection()
public void setCollection(String collection)
public int compareTo(Key<T> other)
Compares based on the following traits, in order:
compareTo
in interface Comparable<Key<T>>
Copyright © 2016. All rights reserved.