All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.gerrit.reviewdb.server.ReviewDbWrapper Maven / Gradle / Ivy

There is a newer version: 3.10.0-rc4
Show newest version
// Copyright (C) 2016 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.gerrit.reviewdb.server;

import static com.google.common.base.Preconditions.checkNotNull;

import com.google.gerrit.reviewdb.client.Account;
import com.google.gerrit.reviewdb.client.Change;
import com.google.gerrit.reviewdb.client.ChangeMessage;
import com.google.gerrit.reviewdb.client.PatchLineComment;
import com.google.gerrit.reviewdb.client.PatchSet;
import com.google.gerrit.reviewdb.client.PatchSetApproval;
import com.google.gwtorm.server.Access;
import com.google.gwtorm.server.AtomicUpdate;
import com.google.gwtorm.server.OrmException;
import com.google.gwtorm.server.ResultSet;
import com.google.gwtorm.server.StatementExecutor;
import java.util.Map;

public class ReviewDbWrapper implements ReviewDb {
  protected final ReviewDb delegate;

  protected ReviewDbWrapper(ReviewDb delegate) {
    this.delegate = checkNotNull(delegate);
  }

  @Override
  public void commit() throws OrmException {
    delegate.commit();
  }

  @Override
  public void rollback() throws OrmException {
    delegate.rollback();
  }

  @Override
  public void updateSchema(StatementExecutor e) throws OrmException {
    delegate.updateSchema(e);
  }

  @Override
  public void pruneSchema(StatementExecutor e) throws OrmException {
    delegate.pruneSchema(e);
  }

  @Override
  public Access[] allRelations() {
    return delegate.allRelations();
  }

  @Override
  public void close() {
    delegate.close();
  }

  @Override
  public SchemaVersionAccess schemaVersion() {
    return delegate.schemaVersion();
  }

  @Override
  public SystemConfigAccess systemConfig() {
    return delegate.systemConfig();
  }

  @Override
  public AccountAccess accounts() {
    return delegate.accounts();
  }

  @Override
  public AccountExternalIdAccess accountExternalIds() {
    return delegate.accountExternalIds();
  }

  @Override
  public AccountGroupAccess accountGroups() {
    return delegate.accountGroups();
  }

  @Override
  public AccountGroupNameAccess accountGroupNames() {
    return delegate.accountGroupNames();
  }

  @Override
  public AccountGroupMemberAccess accountGroupMembers() {
    return delegate.accountGroupMembers();
  }

  @Override
  public AccountGroupMemberAuditAccess accountGroupMembersAudit() {
    return delegate.accountGroupMembersAudit();
  }

  @Override
  public ChangeAccess changes() {
    return delegate.changes();
  }

  @Override
  public PatchSetApprovalAccess patchSetApprovals() {
    return delegate.patchSetApprovals();
  }

  @Override
  public ChangeMessageAccess changeMessages() {
    return delegate.changeMessages();
  }

  @Override
  public PatchSetAccess patchSets() {
    return delegate.patchSets();
  }

  @Override
  public PatchLineCommentAccess patchComments() {
    return delegate.patchComments();
  }

  @Override
  public AccountGroupByIdAccess accountGroupById() {
    return delegate.accountGroupById();
  }

  @Override
  public AccountGroupByIdAudAccess accountGroupByIdAud() {
    return delegate.accountGroupByIdAud();
  }

  @Override
  public int nextAccountId() throws OrmException {
    return delegate.nextAccountId();
  }

  @Override
  public int nextAccountGroupId() throws OrmException {
    return delegate.nextAccountGroupId();
  }

  @Override
  @SuppressWarnings("deprecation")
  public int nextChangeId() throws OrmException {
    return delegate.nextChangeId();
  }

  public static class ChangeAccessWrapper implements ChangeAccess {
    protected final ChangeAccess delegate;

    protected ChangeAccessWrapper(ChangeAccess delegate) {
      this.delegate = checkNotNull(delegate);
    }

    @Override
    public String getRelationName() {
      return delegate.getRelationName();
    }

    @Override
    public int getRelationID() {
      return delegate.getRelationID();
    }

    @Override
    public ResultSet iterateAllEntities() throws OrmException {
      return delegate.iterateAllEntities();
    }

    @Override
    public Change.Id primaryKey(Change entity) {
      return delegate.primaryKey(entity);
    }

    @Override
    public Map toMap(Iterable c) {
      return delegate.toMap(c);
    }

    @SuppressWarnings("deprecation")
    @Override
    public com.google.common.util.concurrent.CheckedFuture getAsync(
        Change.Id key) {
      return delegate.getAsync(key);
    }

    @Override
    public ResultSet get(Iterable keys) throws OrmException {
      return delegate.get(keys);
    }

    @Override
    public void insert(Iterable instances) throws OrmException {
      delegate.insert(instances);
    }

    @Override
    public void update(Iterable instances) throws OrmException {
      delegate.update(instances);
    }

    @Override
    public void upsert(Iterable instances) throws OrmException {
      delegate.upsert(instances);
    }

    @Override
    public void deleteKeys(Iterable keys) throws OrmException {
      delegate.deleteKeys(keys);
    }

    @Override
    public void delete(Iterable instances) throws OrmException {
      delegate.delete(instances);
    }

    @Override
    public void beginTransaction(Change.Id key) throws OrmException {
      delegate.beginTransaction(key);
    }

    @Override
    public Change atomicUpdate(Change.Id key, AtomicUpdate update) throws OrmException {
      return delegate.atomicUpdate(key, update);
    }

    @Override
    public Change get(Change.Id id) throws OrmException {
      return delegate.get(id);
    }

    @Override
    public ResultSet all() throws OrmException {
      return delegate.all();
    }
  }

  public static class PatchSetApprovalAccessWrapper implements PatchSetApprovalAccess {
    protected final PatchSetApprovalAccess delegate;

    protected PatchSetApprovalAccessWrapper(PatchSetApprovalAccess delegate) {
      this.delegate = delegate;
    }

    @Override
    public String getRelationName() {
      return delegate.getRelationName();
    }

    @Override
    public int getRelationID() {
      return delegate.getRelationID();
    }

    @Override
    public ResultSet iterateAllEntities() throws OrmException {
      return delegate.iterateAllEntities();
    }

    @Override
    public PatchSetApproval.Key primaryKey(PatchSetApproval entity) {
      return delegate.primaryKey(entity);
    }

    @Override
    public Map toMap(Iterable c) {
      return delegate.toMap(c);
    }

    @SuppressWarnings("deprecation")
    @Override
    public com.google.common.util.concurrent.CheckedFuture getAsync(
        PatchSetApproval.Key key) {
      return delegate.getAsync(key);
    }

    @Override
    public ResultSet get(Iterable keys)
        throws OrmException {
      return delegate.get(keys);
    }

    @Override
    public void insert(Iterable instances) throws OrmException {
      delegate.insert(instances);
    }

    @Override
    public void update(Iterable instances) throws OrmException {
      delegate.update(instances);
    }

    @Override
    public void upsert(Iterable instances) throws OrmException {
      delegate.upsert(instances);
    }

    @Override
    public void deleteKeys(Iterable keys) throws OrmException {
      delegate.deleteKeys(keys);
    }

    @Override
    public void delete(Iterable instances) throws OrmException {
      delegate.delete(instances);
    }

    @Override
    public void beginTransaction(PatchSetApproval.Key key) throws OrmException {
      delegate.beginTransaction(key);
    }

    @Override
    public PatchSetApproval atomicUpdate(
        PatchSetApproval.Key key, AtomicUpdate update) throws OrmException {
      return delegate.atomicUpdate(key, update);
    }

    @Override
    public PatchSetApproval get(PatchSetApproval.Key key) throws OrmException {
      return delegate.get(key);
    }

    @Override
    public ResultSet byChange(Change.Id id) throws OrmException {
      return delegate.byChange(id);
    }

    @Override
    public ResultSet byPatchSet(PatchSet.Id id) throws OrmException {
      return delegate.byPatchSet(id);
    }

    @Override
    public ResultSet byPatchSetUser(PatchSet.Id patchSet, Account.Id account)
        throws OrmException {
      return delegate.byPatchSetUser(patchSet, account);
    }

    @Override
    public ResultSet all() throws OrmException {
      return delegate.all();
    }
  }

  public static class ChangeMessageAccessWrapper implements ChangeMessageAccess {
    protected final ChangeMessageAccess delegate;

    protected ChangeMessageAccessWrapper(ChangeMessageAccess delegate) {
      this.delegate = delegate;
    }

    @Override
    public String getRelationName() {
      return delegate.getRelationName();
    }

    @Override
    public int getRelationID() {
      return delegate.getRelationID();
    }

    @Override
    public ResultSet iterateAllEntities() throws OrmException {
      return delegate.iterateAllEntities();
    }

    @Override
    public ChangeMessage.Key primaryKey(ChangeMessage entity) {
      return delegate.primaryKey(entity);
    }

    @Override
    public Map toMap(Iterable c) {
      return delegate.toMap(c);
    }

    @SuppressWarnings("deprecation")
    @Override
    public com.google.common.util.concurrent.CheckedFuture getAsync(
        ChangeMessage.Key key) {
      return delegate.getAsync(key);
    }

    @Override
    public ResultSet get(Iterable keys) throws OrmException {
      return delegate.get(keys);
    }

    @Override
    public void insert(Iterable instances) throws OrmException {
      delegate.insert(instances);
    }

    @Override
    public void update(Iterable instances) throws OrmException {
      delegate.update(instances);
    }

    @Override
    public void upsert(Iterable instances) throws OrmException {
      delegate.upsert(instances);
    }

    @Override
    public void deleteKeys(Iterable keys) throws OrmException {
      delegate.deleteKeys(keys);
    }

    @Override
    public void delete(Iterable instances) throws OrmException {
      delegate.delete(instances);
    }

    @Override
    public void beginTransaction(ChangeMessage.Key key) throws OrmException {
      delegate.beginTransaction(key);
    }

    @Override
    public ChangeMessage atomicUpdate(ChangeMessage.Key key, AtomicUpdate update)
        throws OrmException {
      return delegate.atomicUpdate(key, update);
    }

    @Override
    public ChangeMessage get(ChangeMessage.Key id) throws OrmException {
      return delegate.get(id);
    }

    @Override
    public ResultSet byChange(Change.Id id) throws OrmException {
      return delegate.byChange(id);
    }

    @Override
    public ResultSet byPatchSet(PatchSet.Id id) throws OrmException {
      return delegate.byPatchSet(id);
    }

    @Override
    public ResultSet all() throws OrmException {
      return delegate.all();
    }
  }

  public static class PatchSetAccessWrapper implements PatchSetAccess {
    protected final PatchSetAccess delegate;

    protected PatchSetAccessWrapper(PatchSetAccess delegate) {
      this.delegate = delegate;
    }

    @Override
    public String getRelationName() {
      return delegate.getRelationName();
    }

    @Override
    public int getRelationID() {
      return delegate.getRelationID();
    }

    @Override
    public ResultSet iterateAllEntities() throws OrmException {
      return delegate.iterateAllEntities();
    }

    @Override
    public PatchSet.Id primaryKey(PatchSet entity) {
      return delegate.primaryKey(entity);
    }

    @Override
    public Map toMap(Iterable c) {
      return delegate.toMap(c);
    }

    @SuppressWarnings("deprecation")
    @Override
    public com.google.common.util.concurrent.CheckedFuture getAsync(
        PatchSet.Id key) {
      return delegate.getAsync(key);
    }

    @Override
    public ResultSet get(Iterable keys) throws OrmException {
      return delegate.get(keys);
    }

    @Override
    public void insert(Iterable instances) throws OrmException {
      delegate.insert(instances);
    }

    @Override
    public void update(Iterable instances) throws OrmException {
      delegate.update(instances);
    }

    @Override
    public void upsert(Iterable instances) throws OrmException {
      delegate.upsert(instances);
    }

    @Override
    public void deleteKeys(Iterable keys) throws OrmException {
      delegate.deleteKeys(keys);
    }

    @Override
    public void delete(Iterable instances) throws OrmException {
      delegate.delete(instances);
    }

    @Override
    public void beginTransaction(PatchSet.Id key) throws OrmException {
      delegate.beginTransaction(key);
    }

    @Override
    public PatchSet atomicUpdate(PatchSet.Id key, AtomicUpdate update)
        throws OrmException {
      return delegate.atomicUpdate(key, update);
    }

    @Override
    public PatchSet get(PatchSet.Id id) throws OrmException {
      return delegate.get(id);
    }

    @Override
    public ResultSet byChange(Change.Id id) throws OrmException {
      return delegate.byChange(id);
    }

    @Override
    public ResultSet all() throws OrmException {
      return delegate.all();
    }
  }

  public static class PatchLineCommentAccessWrapper implements PatchLineCommentAccess {
    protected PatchLineCommentAccess delegate;

    protected PatchLineCommentAccessWrapper(PatchLineCommentAccess delegate) {
      this.delegate = delegate;
    }

    @Override
    public String getRelationName() {
      return delegate.getRelationName();
    }

    @Override
    public int getRelationID() {
      return delegate.getRelationID();
    }

    @Override
    public ResultSet iterateAllEntities() throws OrmException {
      return delegate.iterateAllEntities();
    }

    @Override
    public PatchLineComment.Key primaryKey(PatchLineComment entity) {
      return delegate.primaryKey(entity);
    }

    @Override
    public Map toMap(Iterable c) {
      return delegate.toMap(c);
    }

    @SuppressWarnings("deprecation")
    @Override
    public com.google.common.util.concurrent.CheckedFuture getAsync(
        PatchLineComment.Key key) {
      return delegate.getAsync(key);
    }

    @Override
    public ResultSet get(Iterable keys)
        throws OrmException {
      return delegate.get(keys);
    }

    @Override
    public void insert(Iterable instances) throws OrmException {
      delegate.insert(instances);
    }

    @Override
    public void update(Iterable instances) throws OrmException {
      delegate.update(instances);
    }

    @Override
    public void upsert(Iterable instances) throws OrmException {
      delegate.upsert(instances);
    }

    @Override
    public void deleteKeys(Iterable keys) throws OrmException {
      delegate.deleteKeys(keys);
    }

    @Override
    public void delete(Iterable instances) throws OrmException {
      delegate.delete(instances);
    }

    @Override
    public void beginTransaction(PatchLineComment.Key key) throws OrmException {
      delegate.beginTransaction(key);
    }

    @Override
    public PatchLineComment atomicUpdate(
        PatchLineComment.Key key, AtomicUpdate update) throws OrmException {
      return delegate.atomicUpdate(key, update);
    }

    @Override
    public PatchLineComment get(PatchLineComment.Key id) throws OrmException {
      return delegate.get(id);
    }

    @Override
    public ResultSet byChange(Change.Id id) throws OrmException {
      return delegate.byChange(id);
    }

    @Override
    public ResultSet byPatchSet(PatchSet.Id id) throws OrmException {
      return delegate.byPatchSet(id);
    }

    @Override
    public ResultSet publishedByChangeFile(Change.Id id, String file)
        throws OrmException {
      return delegate.publishedByChangeFile(id, file);
    }

    @Override
    public ResultSet publishedByPatchSet(PatchSet.Id patchset)
        throws OrmException {
      return delegate.publishedByPatchSet(patchset);
    }

    @Override
    public ResultSet draftByPatchSetAuthor(
        PatchSet.Id patchset, Account.Id author) throws OrmException {
      return delegate.draftByPatchSetAuthor(patchset, author);
    }

    @Override
    public ResultSet draftByChangeFileAuthor(
        Change.Id id, String file, Account.Id author) throws OrmException {
      return delegate.draftByChangeFileAuthor(id, file, author);
    }

    @Override
    public ResultSet draftByAuthor(Account.Id author) throws OrmException {
      return delegate.draftByAuthor(author);
    }

    @Override
    public ResultSet all() throws OrmException {
      return delegate.all();
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy