views:

78

answers:

2

What is the difference between Kind and Entity in Google App Engine datastore?

+1  A: 

'Kind' usually refers to simplified name of your entity class:

String kind = myEntity.getClass().getSimpleName();

But it might be whatever you set it to be. (If the persistence framework allows you to. I'd recommend Objectify BTW. :)
With Objectify you can define it like this:

@Entity(name = "MSSE")
class MySuperSmartEntity
{
}

Setting kind to something shorter than what is the class name might save you some serious decent space in datastore indexes.

Jaroslav Záruba
+5  A: 

An Entity is an individual record that gets stored and retrieved from the datastore.

The Kind is the unique string identifier of the type of entity.

For example, "Joe" is an Entity with age=42, dob=10-12-2000, and Kind "Person".

Nick Johnson