The repository requires that there be an attribute in the entity class for the key, and that it must be identified by the @Id annotation. It is not unusual to put the key in the entity so that the code knows what the key is if the entity is the only object the code has access to. However, there are situations in Gemfire where the key should not be in the entity. When a key/entity pair is deserialized from the file system or via a remote call there are actually two instances of the key in memory since Gemfire doesn't know to resolve the two keys into a single instance. This can consume extra heap unnecessarily, which will probably be tenured. The repository cannot be used if the entity does not have the key.