code: public EntityManager createEntityManager(ConnectionParameters parameters) {
      try {
        DatastoreOptions.Builder datastoreOptionsBuilder = DatastoreOptions.newBuilder();
        datastoreOptionsBuilder.setHost(parameters.getServiceURL());
        datastoreOptionsBuilder.setTransportOptions(getHttpTransportOptions(parameters));
        String projectId = parameters.getProjectId();
        if (!Utility.isNullOrEmpty(projectId)) {
          datastoreOptionsBuilder.setProjectId(projectId);
        }
        String namespace = parameters.getNamespace();
        if (namespace != null) {
          datastoreOptionsBuilder.setNamespace(namespace);
        }
        datastoreOptionsBuilder.setCredentials(getCredentials(parameters));
        Datastore datastore = datastoreOptionsBuilder.build().getService();
        return new DefaultEntityManager(datastore);
      } catch (Exception exp) {
        throw new EntityManagerFactoryException(exp);
      }
    }
docs: Creates and returns an {@link EntityManager} using the specified connection parameters.
  
  @param parameters
  the connection parameters
  @return a new {@link EntityManager} created using the specified connection parameters.
  @throws EntityManagerException
  if any error occurs while creating the EntityManager.