diff --git a/WORKSPACE b/WORKSPACE
index 1dac920..8438894 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -3,7 +3,7 @@
 load("//:bazlets.bzl", "load_bazlets")
 
 load_bazlets(
-    commit = "15eae2ee5cd524a204bd62c3d59bfd0ce86916ec",
+    commit = "fbe2b2fd07c95d752dced6b8624c9d5a08e8c6c6",
     #local_path = "/home/<user>/projects/bazlets",
 )
 
@@ -24,18 +24,18 @@
 
 load("//tools/bzl:maven_jar.bzl", "GERRIT", "maven_jar")
 
-AUTO_VALUE_VERSION = "1.6.5"
+AUTO_VALUE_VERSION = "1.7"
 
 maven_jar(
     name = "auto-value",
     artifact = "com.google.auto.value:auto-value:" + AUTO_VALUE_VERSION,
-    sha1 = "816872c85048f36a67a276ef7a49cc2e4595711c",
+    sha1 = "fe8387764ed19460eda4f106849c664f51c07121",
 )
 
 maven_jar(
     name = "auto-value-annotations",
     artifact = "com.google.auto.value:auto-value-annotations:" + AUTO_VALUE_VERSION,
-    sha1 = "c3dad10377f0e2242c9a4b88e9704eaf79103679",
+    sha1 = "5be124948ebdc7807df68207f35a0f23ce427f29",
 )
 
 # Load snapshot Plugin API
diff --git a/pom.xml b/pom.xml
index b1ea7c7..0ef2e07 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,13 +22,13 @@
   <groupId>com.googlesource.gerrit.plugins.batch</groupId>
   <artifactId>batch</artifactId>
   <packaging>jar</packaging>
-  <version>3.0.9</version>
+  <version>3.1.0</version>
   <name>batch</name>
 
   <properties>
     <Gerrit-ApiType>plugin</Gerrit-ApiType>
     <Gerrit-ApiVersion>${project.version}</Gerrit-ApiVersion>
-    <auto-value.version>1.6.5</auto-value.version>
+    <auto-value.version>1.7</auto-value.version>
   </properties>
 
   <build>
diff --git a/src/main/java/com/google/gerrit/entities/FileNameKey.java b/src/main/java/com/google/gerrit/entities/FileNameKey.java
index d415278..63531a5 100644
--- a/src/main/java/com/google/gerrit/entities/FileNameKey.java
+++ b/src/main/java/com/google/gerrit/entities/FileNameKey.java
@@ -15,21 +15,21 @@
 package com.google.gerrit.entities;
 
 import com.google.auto.value.AutoValue;
-import com.google.gerrit.reviewdb.client.Branch;
-import com.google.gerrit.reviewdb.client.Project;
+import com.google.gerrit.entities.BranchNameKey;
+import com.google.gerrit.entities.Project;
 
 /** An immutable reference to a file in gerrit repo. */
 @AutoValue
 public abstract class FileNameKey implements Comparable<FileNameKey> {
-  public static FileNameKey create(Branch.NameKey branch, String file) {
+  public static FileNameKey create(BranchNameKey branch, String file) {
     return new AutoValue_FileNameKey(branch, file);
   }
 
   public static FileNameKey create() {
-    return new AutoValue_FileNameKey(new Branch.NameKey(new Project.NameKey(null), null), null);
+    return new AutoValue_FileNameKey(BranchNameKey.create(Project.nameKey(null), null), null);
   }
 
-  public abstract Branch.NameKey branch();
+  public abstract BranchNameKey branch();
   public abstract String file();
 
   @Override
diff --git a/src/main/java/com/google/gerrit/server/git/meta/GitFile.java b/src/main/java/com/google/gerrit/server/git/meta/GitFile.java
index 4fe617d..2bf5a14 100644
--- a/src/main/java/com/google/gerrit/server/git/meta/GitFile.java
+++ b/src/main/java/com/google/gerrit/server/git/meta/GitFile.java
@@ -14,9 +14,9 @@
 
 package com.google.gerrit.server.git.meta;
 
-import com.google.gerrit.reviewdb.client.Branch;
-import com.google.gerrit.reviewdb.client.Project;
+import com.google.gerrit.entities.BranchNameKey;
 import com.google.gerrit.entities.FileNameKey;
+import com.google.gerrit.entities.Project;
 import com.google.gerrit.server.git.GitRepositoryManager;
 import com.google.gerrit.server.project.NoSuchProjectException;
 import com.google.inject.Inject;
@@ -37,7 +37,7 @@
   protected final MetaDataUpdate.User metaDataUpdateFactory;
   protected final GitRepositoryManager repos;
 
-  protected Branch.NameKey branch;
+  protected BranchNameKey branch;
   protected String file;
 
   public String text;
@@ -54,7 +54,7 @@
   }
 
   public String read() throws ConfigInvalidException, IOException, NoSuchProjectException {
-    Project.NameKey project = branch.getParentKey();
+    Project.NameKey project = branch.project();
     try (Repository repo = repos.openRepository(project)) {
       load(project, repo);
       return text;
@@ -65,7 +65,7 @@
 
   public RevCommit write(String fileContent, String commitMessage)
       throws ConfigInvalidException, IOException, NoSuchProjectException {
-    Project.NameKey project = branch.getParentKey();
+    Project.NameKey project = branch.project();
     try (MetaDataUpdate md = metaDataUpdateFactory.create(project)) {
       load(md);
       text = fileContent;
@@ -77,7 +77,7 @@
     }
   }
 
-  public void setBranch(Branch.NameKey branch) {
+  public void setBranch(BranchNameKey branch) {
     this.branch = branch;
   }
 
@@ -87,7 +87,7 @@
 
   @Override
   protected String getRefName() {
-    return branch.get();
+    return branch.branch();
   }
 
   @Override
diff --git a/src/main/java/com/google/gerrit/server/util/RefUpdater.java b/src/main/java/com/google/gerrit/server/util/RefUpdater.java
index 818d857..1f4dfd1 100644
--- a/src/main/java/com/google/gerrit/server/util/RefUpdater.java
+++ b/src/main/java/com/google/gerrit/server/util/RefUpdater.java
@@ -14,8 +14,8 @@
 package com.google.gerrit.server.util;
 
 import com.google.common.flogger.FluentLogger;
-import com.google.gerrit.reviewdb.client.Branch;
-import com.google.gerrit.reviewdb.client.Project;
+import com.google.gerrit.entities.BranchNameKey;
+import com.google.gerrit.entities.Project;
 import com.google.gerrit.server.CurrentUser;
 import com.google.gerrit.server.GerritPersonIdent;
 import com.google.gerrit.server.IdentifiedUser;
@@ -38,14 +38,14 @@
   private static final FluentLogger log = FluentLogger.forEnclosingClass();
 
   public class Args {
-    public final Branch.NameKey branch;
+    public final BranchNameKey branch;
     public ObjectId expectedOldObjectId;
     public ObjectId newObjectId;
     public boolean isForceUpdate;
     public PersonIdent refLogIdent;
     public String refLogMessage;
 
-    public Args(Branch.NameKey branch) {
+    public Args(BranchNameKey branch) {
       this.branch = branch;
       CurrentUser user = userProvider.get();
       if (user instanceof IdentifiedUser) {
@@ -79,13 +79,13 @@
     this.gitRefUpdated = gitRefUpdated;
   }
 
-  public void update(Branch.NameKey branch, ObjectId oldRefId, ObjectId newRefId)
+  public void update(BranchNameKey branch, ObjectId oldRefId, ObjectId newRefId)
       throws IOException, NoSuchProjectException {
     this.update(branch, oldRefId, newRefId, null);
   }
 
   public void update(
-      Branch.NameKey branch, ObjectId oldRefId, ObjectId newRefId, String refLogMessage)
+      BranchNameKey branch, ObjectId oldRefId, ObjectId newRefId, String refLogMessage)
       throws IOException, NoSuchProjectException {
     Args args = new Args(branch);
     args.expectedOldObjectId = oldRefId;
@@ -94,12 +94,12 @@
     this.update(args);
   }
 
-  public void forceUpdate(Branch.NameKey branch, ObjectId newRefId)
+  public void forceUpdate(BranchNameKey branch, ObjectId newRefId)
       throws IOException, NoSuchProjectException {
     this.forceUpdate(branch, newRefId, null);
   }
 
-  public void forceUpdate(Branch.NameKey branch, ObjectId newRefId, String refLogMessage)
+  public void forceUpdate(BranchNameKey branch, ObjectId newRefId, String refLogMessage)
       throws IOException, NoSuchProjectException {
     Args args = new Args(branch);
     args.newObjectId = newRefId;
@@ -108,7 +108,7 @@
     update(args);
   }
 
-  public void delete(Branch.NameKey branch) throws IOException, NoSuchProjectException {
+  public void delete(BranchNameKey branch) throws IOException, NoSuchProjectException {
     Args args = new Args(branch);
     args.newObjectId = ObjectId.zeroId();
     args.isForceUpdate = true;
@@ -123,14 +123,14 @@
     protected Repository repo;
     protected Args args;
     protected RefUpdate update;
-    protected Branch.NameKey branch;
+    protected BranchNameKey branch;
     protected Project.NameKey project;
     protected boolean delete;
 
     protected Update(Args args) {
       this.args = args;
       branch = args.branch;
-      project = branch.getParentKey();
+      project = branch.project();
       delete = args.newObjectId.equals(ObjectId.zeroId());
     }
 
@@ -142,7 +142,7 @@
           handleResult(runUpdate());
         } catch (IOException err) {
           log.atSevere().withCause(err).log(
-              "RefUpdate failed: branch not updated: %s", branch.get());
+              "RefUpdate failed: branch not updated: %s", branch.branch());
           throw err;
         } finally {
           repo.close();
@@ -154,7 +154,7 @@
     }
 
     protected void initUpdate() throws IOException {
-      update = repo.updateRef(branch.get());
+      update = repo.updateRef(branch.branch());
       update.setExpectedOldObjectId(args.expectedOldObjectId);
       update.setNewObjectId(args.newObjectId);
       update.setRefLogIdent(args.refLogIdent);
diff --git a/src/main/java/com/googlesource/gerrit/plugins/batch/Batch.java b/src/main/java/com/googlesource/gerrit/plugins/batch/Batch.java
index 79c1d36..cb5af67 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/batch/Batch.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/batch/Batch.java
@@ -13,9 +13,9 @@
 // limitations under the License.
 package com.googlesource.gerrit.plugins.batch;
 
-import com.google.gerrit.reviewdb.client.Account;
-import com.google.gerrit.reviewdb.client.Branch;
-import com.google.gerrit.reviewdb.client.PatchSet;
+import com.google.gerrit.entities.Account;
+import com.google.gerrit.entities.BranchNameKey;
+import com.google.gerrit.entities.PatchSet;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Date;
@@ -35,12 +35,12 @@
     int patchSet;
 
     Change(PatchSet.Id psId) {
-      number = psId.getParentKey().get();
+      number = psId.changeId().get();
       patchSet = psId.get();
     }
 
     public PatchSet.Id toPatchSetId() {
-      return new PatchSet.Id(new com.google.gerrit.reviewdb.client.Change.Id(number), patchSet);
+      return PatchSet.id(com.google.gerrit.entities.Change.id(number), patchSet);
     }
   }
 
@@ -86,26 +86,26 @@
     return destinations;
   }
 
-  public Destination getDestination(Branch.NameKey branch) {
+  public Destination getDestination(BranchNameKey branch) {
     if (destinations == null) {
       destinations = new ArrayList<>();
     }
     Destination dest = getExistingDestination(branch);
     if (dest == null) {
       dest = new Destination();
-      dest.project = branch.getParentKey().get();
-      dest.ref = branch.get();
+      dest.project = branch.project().get();
+      dest.ref = branch.branch();
       destinations.add(dest);
     }
     return dest;
   }
 
-  protected Destination getExistingDestination(Branch.NameKey branch) {
+  protected Destination getExistingDestination(BranchNameKey branch) {
     if (destinations == null) {
       destinations = new ArrayList<>();
     }
     for (Destination dest : destinations) {
-      if (dest.project.equals(branch.getParentKey().get()) && dest.ref.equals(branch.get())) {
+      if (dest.project.equals(branch.project().get()) && dest.ref.equals(branch.branch())) {
         return dest;
       }
     }
diff --git a/src/main/java/com/googlesource/gerrit/plugins/batch/BatchCloser.java b/src/main/java/com/googlesource/gerrit/plugins/batch/BatchCloser.java
index a528d2f..e66ba76 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/batch/BatchCloser.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/batch/BatchCloser.java
@@ -13,8 +13,8 @@
 // limitations under the License.
 package com.googlesource.gerrit.plugins.batch;
 
-import com.google.gerrit.reviewdb.client.Branch;
-import com.google.gerrit.reviewdb.client.Project;
+import com.google.gerrit.entities.BranchNameKey;
+import com.google.gerrit.entities.Project;
 import com.google.gerrit.server.IdentifiedUser;
 import com.google.gerrit.server.project.NoSuchProjectException;
 import com.google.gerrit.server.util.RefUpdater;
@@ -47,8 +47,8 @@
   protected void createDownloadRefs(Batch batch) throws IOException, NoSuchProjectException {
     for (Batch.Destination dest : batch.listDestinations()) {
       dest.downloadRef = getBatchRef(batch, dest);
-      Project.NameKey project = new Project.NameKey(dest.project);
-      Branch.NameKey branch = new Branch.NameKey(project, dest.downloadRef);
+      Project.NameKey project = Project.nameKey(dest.project);
+      BranchNameKey branch = BranchNameKey.create(project, dest.downloadRef);
       ObjectId id = ObjectId.fromString(dest.sha1);
       refUpdater.update(branch, ObjectId.zeroId(), id);
     }
diff --git a/src/main/java/com/googlesource/gerrit/plugins/batch/BatchRemover.java b/src/main/java/com/googlesource/gerrit/plugins/batch/BatchRemover.java
index ffb7b41..ac52e2a 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/batch/BatchRemover.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/batch/BatchRemover.java
@@ -14,8 +14,8 @@
 
 package com.googlesource.gerrit.plugins.batch;
 
-import com.google.gerrit.reviewdb.client.Branch;
-import com.google.gerrit.reviewdb.client.Project;
+import com.google.gerrit.entities.BranchNameKey;
+import com.google.gerrit.entities.Project;
 import com.google.gerrit.server.project.NoSuchProjectException;
 import com.google.gerrit.server.util.RefUpdater;
 import com.google.inject.Inject;
@@ -55,8 +55,8 @@
   protected void removeDownloadRefs(Batch batch)
       throws IOException, RepositoryNotFoundException, NoSuchProjectException {
     for (Batch.Destination dest : batch.listDestinations()) {
-      Project.NameKey project = new Project.NameKey(dest.project);
-      Branch.NameKey branch = new Branch.NameKey(project, dest.downloadRef);
+      Project.NameKey project = Project.nameKey(dest.project);
+      BranchNameKey branch = BranchNameKey.create(project, dest.downloadRef);
       refUpdater.delete(branch);
     }
   }
diff --git a/src/main/java/com/googlesource/gerrit/plugins/batch/BatchStore.java b/src/main/java/com/googlesource/gerrit/plugins/batch/BatchStore.java
index 7290148..7ce10a6 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/batch/BatchStore.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/batch/BatchStore.java
@@ -13,18 +13,28 @@
 // limitations under the License.
 package com.googlesource.gerrit.plugins.batch;
 
-import com.google.gerrit.reviewdb.client.Branch;
+import com.google.gerrit.entities.Account;
+import com.google.gerrit.entities.BranchNameKey;
 import com.google.gerrit.entities.FileNameKey;
-import com.google.gerrit.reviewdb.client.Project;
+import com.google.gerrit.entities.Project;
 import com.google.gerrit.server.config.AllProjectsName;
 import com.google.gerrit.server.git.GitRepositoryManager;
 import com.google.gerrit.server.git.meta.GitFile;
 import com.google.gerrit.server.project.NoSuchProjectException;
 import com.google.gerrit.server.util.RefUpdater;
 import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.JsonDeserializationContext;
+import com.google.gson.JsonDeserializer;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonParseException;
+import com.google.gson.JsonPrimitive;
+import com.google.gson.JsonSerializationContext;
+import com.google.gson.JsonSerializer;
 import com.google.inject.Inject;
 import com.googlesource.gerrit.plugins.batch.exception.NoSuchBatchException;
 import java.io.IOException;
+import java.lang.reflect.Type;
 import java.util.ArrayList;
 import java.util.ConcurrentModificationException;
 import java.util.Date;
@@ -39,11 +49,32 @@
   public static final String BATCHES_REF = "refs/meta/batch/batches/";
   public static final String FILE_NAME = "batch.json";
 
+  public static class AccountIdDeserializer
+      implements JsonDeserializer<Account.Id>, JsonSerializer<Account.Id> {
+
+    @Override
+    public Account.Id deserialize(
+        JsonElement json, Type typeOfT, JsonDeserializationContext context)
+        throws JsonParseException {
+      if (json.isJsonNull() || !json.isJsonPrimitive() || !json.getAsJsonPrimitive().isNumber()) {
+        throw new JsonParseException("Expected int for account.id type");
+      }
+      JsonPrimitive p = (JsonPrimitive) json;
+      return Account.id(p.getAsInt());
+    }
+
+    @Override
+    public JsonElement serialize(Account.Id id, Type typeOfSrc, JsonSerializationContext context) {
+      return new JsonPrimitive(id.get());
+    }
+  }
+
   protected final GitRepositoryManager repoManager;
   protected final Project.NameKey project;
   protected final GitFile.Factory gitFileFactory;
   protected final RefUpdater refUpdater;
-  protected final Gson gson = new Gson();
+  protected final Gson gson =
+      new GsonBuilder().registerTypeAdapter(Account.Id.class, new AccountIdDeserializer()).create();
 
   @Inject
   public BatchStore(
@@ -110,11 +141,11 @@
     return getFileNameKey(getBranch(id));
   }
 
-  protected Branch.NameKey getBranch(String id) {
-    return new Branch.NameKey(project, BATCHES_REF + id);
+  protected BranchNameKey getBranch(String id) {
+    return BranchNameKey.create(project, BATCHES_REF + id);
   }
 
-  protected FileNameKey getFileNameKey(Branch.NameKey branch) {
+  protected FileNameKey getFileNameKey(BranchNameKey branch) {
     return FileNameKey.create(branch, FILE_NAME);
   }
 }
diff --git a/src/main/java/com/googlesource/gerrit/plugins/batch/BatchSubmitter.java b/src/main/java/com/googlesource/gerrit/plugins/batch/BatchSubmitter.java
index 018f524..82b944e 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/batch/BatchSubmitter.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/batch/BatchSubmitter.java
@@ -15,12 +15,12 @@
 package com.googlesource.gerrit.plugins.batch;
 
 import com.google.common.flogger.FluentLogger;
+import com.google.gerrit.entities.BranchNameKey;
+import com.google.gerrit.entities.Change;
+import com.google.gerrit.entities.PatchSet;
+import com.google.gerrit.entities.Project;
 import com.google.gerrit.extensions.restapi.AuthException;
 import com.google.gerrit.extensions.restapi.RestApiException;
-import com.google.gerrit.reviewdb.client.Branch;
-import com.google.gerrit.reviewdb.client.Change;
-import com.google.gerrit.reviewdb.client.PatchSet;
-import com.google.gerrit.reviewdb.client.Project;
 import com.google.gerrit.server.IdentifiedUser;
 import com.google.gerrit.server.PatchSetUtil;
 import com.google.gerrit.server.git.GitRepositoryManager;
@@ -111,7 +111,7 @@
   private void ensureCanSubmit(Batch.Destination dest)
       throws AuthException, PermissionBackendException {
     PermissionBackend.ForProject permissions =
-        permissionBackend.user(user).project(new Project.NameKey(dest.project));
+        permissionBackend.user(user).project(Project.nameKey(dest.project));
     permissions.ref(dest.ref).check(RefPermission.FORCE_UPDATE);
   }
 
@@ -126,8 +126,8 @@
 
   private void updateRef(Batch.Destination dest)
       throws IOException, NoSuchProjectException, RepositoryNotFoundException {
-    Project.NameKey project = new Project.NameKey(dest.project);
-    Branch.NameKey branch = new Branch.NameKey(project, dest.ref);
+    Project.NameKey project = Project.nameKey(dest.project);
+    BranchNameKey branch = BranchNameKey.create(project, dest.ref);
     refUpdater.forceUpdate(branch, ObjectId.fromString(dest.sha1));
   }
 
@@ -144,7 +144,7 @@
   private void closeChange(PatchSet.Id psId, String sha1)
       throws IOException, RepositoryNotFoundException, RestApiException, UpdateException,
           PermissionBackendException {
-    ChangeNotes changeNotes = notesFactory.createChecked(psId.getParentKey());
+    ChangeNotes changeNotes = notesFactory.createChecked(psId.changeId());
     permissionBackend.user(user).change(changeNotes).check(ChangePermission.READ);
     Change change = changeNotes.getChange();
     PatchSet ps = psUtil.get(changeNotes, psId);
@@ -157,8 +157,8 @@
         || change.getStatus() == Change.Status.ABANDONED) {
       return;
     }
-    Branch.NameKey destination = change.getDest();
-    Project.NameKey project = destination.getParentKey();
+    BranchNameKey destination = change.getDest();
+    Project.NameKey project = destination.project();
 
     try (TraceContext traceContext =
             TraceContext.open()
@@ -171,8 +171,8 @@
       bu.setRepository(repo, walk, ins);
       bu.setRefLogMessage("merged (batch submit)");
       bu.addOp(
-          psId.getParentKey(),
-          mergedByPushOpFactory.create(requestScopePropagator, psId, destination.get(), sha1));
+          psId.changeId(),
+          mergedByPushOpFactory.create(requestScopePropagator, psId, destination.branch(), sha1));
       bu.execute();
     }
   }
diff --git a/src/main/java/com/googlesource/gerrit/plugins/batch/cli/PatchSetArgument.java b/src/main/java/com/googlesource/gerrit/plugins/batch/cli/PatchSetArgument.java
index 4feb2fa..78d173a 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/batch/cli/PatchSetArgument.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/batch/cli/PatchSetArgument.java
@@ -13,9 +13,9 @@
 // limitations under the License.
 package com.googlesource.gerrit.plugins.batch.cli;
 
+import com.google.gerrit.entities.Change;
+import com.google.gerrit.entities.PatchSet;
 import com.google.gerrit.extensions.restapi.AuthException;
-import com.google.gerrit.reviewdb.client.Change;
-import com.google.gerrit.reviewdb.client.PatchSet;
 import com.google.gerrit.server.CurrentUser;
 import com.google.gerrit.server.PatchSetUtil;
 import com.google.gerrit.server.notedb.ChangeNotes;
@@ -47,7 +47,7 @@
     public PatchSetArgument createForArgument(String token) {
       try {
         PatchSet.Id patchSetId = parsePatchSet(token);
-        ChangeNotes changeNotes = notesFactory.createChecked(patchSetId.getParentKey());
+        ChangeNotes changeNotes = notesFactory.createChecked(patchSetId.changeId());
         permissionBackend.user(user).change(changeNotes).check(ChangePermission.READ);
         return new PatchSetArgument(changeNotes.getChange(), psUtil.get(changeNotes, patchSetId));
       } catch (PermissionBackendException | AuthException e) {
@@ -87,7 +87,7 @@
   }
 
   public void ensureLatest() {
-    if (!change.currentPatchSetId().equals(patchSet.getId())) {
+    if (!change.currentPatchSetId().equals(patchSet.id())) {
       throw new IllegalArgumentException(patchSet + " is not the latest patch set");
     }
   }
diff --git a/src/main/java/com/googlesource/gerrit/plugins/batch/ssh/ListCommand.java b/src/main/java/com/googlesource/gerrit/plugins/batch/ssh/ListCommand.java
index 8adf607..6f78ecb 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/batch/ssh/ListCommand.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/batch/ssh/ListCommand.java
@@ -20,6 +20,7 @@
 import com.google.inject.Inject;
 import com.googlesource.gerrit.plugins.batch.ListBatches;
 import org.apache.sshd.server.Environment;
+import org.apache.sshd.server.channel.ChannelSession;
 
 @CommandMetaData(name = "ls-batches", description = "List batches visible to caller")
 public class ListCommand extends BaseCommand {
@@ -31,7 +32,7 @@
   }
 
   @Override
-  public void start(final Environment env) {
+  public void start(ChannelSession channel, final Environment env) {
     startThread(
         new CommandRunnable() {
           @Override
diff --git a/src/main/java/com/googlesource/gerrit/plugins/batch/ssh/MergeChangeCommand.java b/src/main/java/com/googlesource/gerrit/plugins/batch/ssh/MergeChangeCommand.java
index 64ccacc..10d8b65 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/batch/ssh/MergeChangeCommand.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/batch/ssh/MergeChangeCommand.java
@@ -13,11 +13,11 @@
 // limitations under the License.
 package com.googlesource.gerrit.plugins.batch.ssh;
 
+import com.google.gerrit.entities.BranchNameKey;
+import com.google.gerrit.entities.Change;
+import com.google.gerrit.entities.PatchSet;
+import com.google.gerrit.entities.Project;
 import com.google.gerrit.json.OutputFormat;
-import com.google.gerrit.reviewdb.client.Branch;
-import com.google.gerrit.reviewdb.client.Change;
-import com.google.gerrit.reviewdb.client.PatchSet;
-import com.google.gerrit.reviewdb.client.Project;
 import com.google.gerrit.server.git.GitRepositoryManager;
 import com.google.gerrit.server.project.NoSuchRefException;
 import com.google.gerrit.sshd.CommandMetaData;
@@ -77,7 +77,7 @@
   protected void addPatchSetId(final String token) {
     PatchSetArgument psa = patchSetArgumentFactory.createForArgument(token);
     psa.ensureLatest();
-    patchSetArgumentsByPatchSet.put(psa.patchSet.getId(), psa);
+    patchSetArgumentsByPatchSet.put(psa.patchSet.id(), psa);
   }
 
   @Inject protected PatchSetArgument.Factory patchSetArgumentFactory;
@@ -130,7 +130,7 @@
       return true;
     }
     for (ObjectId parent : parents) {
-      Project.NameKey project = psarg.change.getDest().getParentKey();
+      Project.NameKey project = psarg.change.getDest().project();
       if (isMergedInto(project, parent, sha1)) {
         return true;
       }
@@ -146,10 +146,10 @@
     }
   }
 
-  protected ObjectId getTip(Branch.NameKey branch)
+  protected ObjectId getTip(BranchNameKey branch)
       throws IOException, NoSuchRefException, RepositoryNotFoundException {
-    try (Repository repo = repoManager.openRepository(branch.getParentKey())) {
-      Ref ref = repo.getRefDatabase().exactRef(branch.get());
+    try (Repository repo = repoManager.openRepository(branch.project())) {
+      Ref ref = repo.getRefDatabase().exactRef(branch.branch());
       if (ref == null) {
         throw new NoSuchRefException(branch.toString());
       }
@@ -159,20 +159,20 @@
 
   protected void merge(Batch batch, Change change, PatchSet ps)
       throws Exception, IOException, NoSuchRefException, UnloggedFailure {
-    Branch.NameKey branch = change.getDest();
+    BranchNameKey branch = change.getDest();
     Batch.Destination dest = batch.getDestination(branch);
     dest.sha1 =
         mergeBranchFactory
             .create(
                 branch,
                 dest.sha1,
-                ps.getRefName(),
+                ps.refName(),
                 strategy.getMergeStrategy(),
                 fastForward.getFastForwardMode(),
                 message)
             .call()
             .getName();
-    dest.add(ps.getId());
+    dest.add(ps.id());
   }
 
   /* A Resolver which ensures that changes are eligible to merge before
@@ -197,12 +197,12 @@
       List<PatchSetArgument> remaining = new ArrayList<>();
       Set<ObjectId> sources = new HashSet<>();
 
-      Destination(Branch.NameKey branch) throws IOException, NoSuchRefException {
+      Destination(BranchNameKey branch) throws IOException, NoSuchRefException {
         sources.add(getTip(branch));
       }
     }
 
-    protected Map<Branch.NameKey, Destination> destinationsByBranches = new HashMap<>();
+    protected Map<BranchNameKey, Destination> destinationsByBranches = new HashMap<>();
     protected List<PatchSetArgument> resolved = new ArrayList<>();
 
     protected Resolver(Iterable<PatchSetArgument> psargs)
@@ -236,7 +236,7 @@
         if (isParentMergedInto(psarg, dest.sources)) {
           found = true;
           resolved.add(psarg);
-          dest.sources.add(ObjectId.fromString(psarg.patchSet.getRevision().get()));
+          dest.sources.add(psarg.patchSet.commitId());
         }
       }
       dest.remaining.removeAll(resolved);
@@ -250,12 +250,12 @@
     }
 
     protected void add(PatchSetArgument psarg) throws IOException, NoSuchRefException {
-      Branch.NameKey branch = psarg.change.getDest();
+      BranchNameKey branch = psarg.change.getDest();
       Destination dest = getDestination(branch);
       dest.remaining.add(psarg);
     }
 
-    protected Destination getDestination(Branch.NameKey b) throws IOException, NoSuchRefException {
+    protected Destination getDestination(BranchNameKey b) throws IOException, NoSuchRefException {
       Destination dest = destinationsByBranches.get(b);
       if (dest == null) {
         dest = new Destination(b);
@@ -266,7 +266,7 @@
   }
 
   protected List<ObjectId> getParents(PatchSetArgument psarg) throws IOException {
-    PatchSet.Id id = psarg.patchSet.getId();
+    PatchSet.Id id = psarg.patchSet.id();
     List<ObjectId> parents = parentsByPsarg.get(id);
     if (parents == null) {
       parents = loadParents(psarg);
@@ -279,7 +279,7 @@
     try (Repository repo = repoManager.openRepository(psarg.change.getProject());
         RevWalk revWalk = new RevWalk(repo)) {
       List<ObjectId> parents = new ArrayList<>();
-      ObjectId id = ObjectId.fromString(psarg.patchSet.getRevision().get());
+      ObjectId id = psarg.patchSet.commitId();
       RevCommit c = revWalk.parseCommit(id);
       for (RevCommit parent : c.getParents()) {
         parents.add(parent);
diff --git a/src/main/java/com/googlesource/gerrit/plugins/batch/util/MergeBranch.java b/src/main/java/com/googlesource/gerrit/plugins/batch/util/MergeBranch.java
index bcec3a7..02831e6 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/batch/util/MergeBranch.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/batch/util/MergeBranch.java
@@ -14,11 +14,11 @@
 package com.googlesource.gerrit.plugins.batch.util;
 
 import com.google.gerrit.common.Nullable;
+import com.google.gerrit.entities.BooleanProjectConfig;
+import com.google.gerrit.entities.BranchNameKey;
+import com.google.gerrit.entities.Project;
+import com.google.gerrit.entities.RefNames;
 import com.google.gerrit.extensions.restapi.BadRequestException;
-import com.google.gerrit.reviewdb.client.BooleanProjectConfig;
-import com.google.gerrit.reviewdb.client.Branch;
-import com.google.gerrit.reviewdb.client.Project;
-import com.google.gerrit.reviewdb.client.RefNames;
 import com.google.gerrit.server.git.GitRepositoryManager;
 import com.google.gerrit.server.project.NoSuchRefException;
 import com.google.gerrit.server.project.ProjectCache;
@@ -38,7 +38,7 @@
 public class MergeBranch implements Callable<ObjectId> {
   public interface Factory {
     MergeBranch create(
-        @Assisted Branch.NameKey destBranch,
+        @Assisted BranchNameKey destBranch,
         @Assisted("destSha") @Nullable String destSha,
         @Assisted("sourceRef") String srcName,
         @Assisted MergeStrategy strategy,
@@ -62,7 +62,7 @@
       GitRepositoryManager repoManager,
       ProjectCache projectCache,
       MergeBuilder.Factory builderFactory,
-      @Assisted Branch.NameKey destBranch,
+      @Assisted BranchNameKey destBranch,
       @Assisted("destSha") @Nullable String destSha,
       @Assisted("sourceRef") String srcName,
       @Assisted("message") @Nullable String message,
@@ -71,8 +71,8 @@
     this.projectCache = projectCache;
     this.repoManager = repoManager;
     this.builderFactory = builderFactory;
-    this.projectName = destBranch.getParentKey();
-    destName = RefNames.fullName(destBranch.get());
+    this.projectName = destBranch.project();
+    destName = RefNames.fullName(destBranch.branch());
     if (destSha != null) {
       this.destId = ObjectId.fromString(destSha);
     }
diff --git a/src/main/java/com/googlesource/gerrit/plugins/batch/util/MergeBuilder.java b/src/main/java/com/googlesource/gerrit/plugins/batch/util/MergeBuilder.java
index 72bd980..7265604 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/batch/util/MergeBuilder.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/batch/util/MergeBuilder.java
@@ -14,7 +14,7 @@
 package com.googlesource.gerrit.plugins.batch.util;
 
 import com.google.gerrit.common.Nullable;
-import com.google.gerrit.reviewdb.client.Project;
+import com.google.gerrit.entities.Project;
 import com.google.gerrit.server.GerritPersonIdent;
 import com.google.gerrit.server.IdentifiedUser;
 import com.google.gerrit.server.git.GitRepositoryManager;
