code: private void createCompleteKey(Key parent, long id) {
      String kind = entityMetadata.getKind();
      if (parent == null) {
        key = entityManager.newNativeKeyFactory().setKind(kind).newKey(id);
      } else {
        key = Key.newBuilder(parent, kind, id).build();
      }
    }
docs: Creates a complete key using the given parameters.
  
  @param parent
  the parent key, may be <code>null</code>.
  @param id
  the numeric ID