public < E > E load ( Class < E > entityClass , DatastoreKey parentKey , long id ) { EntityMetadata entityMetadata = EntityIntrospector . introspect ( entityClass ) ; Key nativeKey ; if ( parentKey == null ) { nativeKey = entityManager . newNativeKeyFactory ( ) . setKind ( entityMetadata . getKind ( ) ) . newKey ( id ) ; } else { nativeKey = Key . newBuilder ( parentKey . nativeKey ( ) , entityMetadata . getKind ( ) , id ) . build ( ) ; } return fetch ( entityClass , nativeKey ) ; }
Loads and returns the entity with the given ID . The entity kind is determined from the supplied class .