// Copyright 2008 Google Inc.
//
// 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.client.reviewdb;

import com.google.gwtorm.client.Relation;
import com.google.gwtorm.client.Schema;
import com.google.gwtorm.client.Sequence;

/** The review service database schema. */
public interface ReviewDb extends Schema {
  @Relation
  SystemConfigAccess systemConfig();

  @Relation
  ApprovalCategoryAccess approvalCategories();

  @Relation
  ApprovalCategoryValueAccess approvalCategoryValues();

  @Relation
  ContributorAgreementAccess contributorAgreements();

  @Relation
  AccountAccess accounts();

  @Relation
  AccountExternalIdAccess accountExternalIds();

  @Relation
  AccountSshKeyAccess accountSshKeys();

  @Relation
  AccountAgreementAccess accountAgreements();

  @Relation
  AccountGroupAccess accountGroups();

  @Relation
  AccountGroupMemberAccess accountGroupMembers();

  @Relation
  StarredChangeAccess starredChanges();

  @Relation
  AccountProjectWatchAccess accountProjectWatches();

  @Relation
  ProjectAccess projects();

  @Relation
  ProjectRightAccess projectRights();

  @Relation
  BranchAccess branches();

  @Relation
  ChangeAccess changes();

  @Relation
  ChangeApprovalAccess changeApprovals();

  @Relation
  ChangeMessageAccess changeMessages();

  @Relation
  PatchSetAccess patchSets();

  @Relation
  PatchSetInfoAccess patchSetInfo();

  @Relation
  PatchSetAncestorAccess patchSetAncestors();

  @Relation
  PatchAccess patches();

  @Relation
  PatchContentAccess patchContents();

  @Relation
  PatchLineCommentAccess patchComments();

  /** Create the next unique id for an {@link Account}. */
  @Sequence(startWith = 1000000)
  int nextAccountId();

  /** Create the next unique id for a {@link ContributorAgreement}. */
  @Sequence
  int nextContributorAgreementId();

  /** Next unique id for a {@link AccountGroup}. */
  @Sequence
  int nextAccountGroupId();

  /** Next unique id for a {@link Project}. */
  @Sequence
  int nextProjectId();

  /** Next unique id for a {@link Branch}. */
  @Sequence
  int nextBranchId();

  /** Next unique id for a {@link Change}. */
  @Sequence
  int nextChangeId();

  @Sequence
  int nextChangeMessageId();
}

@@ -622,16 +622,62 @@
 iewdb;%0A%0A
+import com.google.gwtorm.client.OrmException;%0A
 import c
@@ -2256,24 +2256,44 @@
 tAccountId()
+ throws OrmException
 ;%0A%0A  /** Cre
@@ -2396,24 +2396,44 @@
 greementId()
+ throws OrmException
 ;%0A%0A  /** Nex
@@ -2509,24 +2509,44 @@
 untGroupId()
+ throws OrmException
 ;%0A%0A  /** Nex
@@ -2612,24 +2612,44 @@
 tProjectId()
+ throws OrmException
 ;%0A%0A  /** Nex
@@ -2713,24 +2713,44 @@
 xtBranchId()
+ throws OrmException
 ;%0A%0A  /** Nex
@@ -2818,16 +2818,36 @@
 angeId()
+ throws OrmException
 ;%0A%0A  @Se
@@ -2880,12 +2880,32 @@
 sageId()
+ throws OrmException
 ;%0A%7D%0A

Add missing throws clauses for number generators in ReviewDb