diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/changedetail/PatchSetDetailFactory.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/changedetail/PatchSetDetailFactory.java index f478d667a6..78f4ded474 100644 --- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/changedetail/PatchSetDetailFactory.java +++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/changedetail/PatchSetDetailFactory.java @@ -128,7 +128,7 @@ class PatchSetDetailFactory extends Handler { byKey.put(p.getKey(), p); } - for (final PatchLineComment c : db.patchComments().published(psIdNew)) { + for (final PatchLineComment c : db.patchComments().publishedByPatchSet(psIdNew)) { final Patch p = byKey.get(c.getKey().getParentKey()); if (p != null) { p.setCommentCount(p.getCommentCount() + 1); @@ -148,7 +148,7 @@ class PatchSetDetailFactory extends Handler { // quickly locate where they have pending drafts, and review them. // final Account.Id me = ((IdentifiedUser) user).getAccountId(); - for (final PatchLineComment c : db.patchComments().draft(psIdNew, me)) { + for (final PatchLineComment c : db.patchComments().draftByPatchSetAuthor(psIdNew, me)) { final Patch p = byKey.get(c.getKey().getParentKey()); if (p != null) { p.setDraftCount(p.getDraftCount() + 1); diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/changedetail/PatchSetPublishDetailFactory.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/changedetail/PatchSetPublishDetailFactory.java index cbddad1e71..8ec1549b8c 100644 --- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/changedetail/PatchSetPublishDetailFactory.java +++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/changedetail/PatchSetPublishDetailFactory.java @@ -84,7 +84,7 @@ final class PatchSetPublishDetailFactory extends Handler final ChangeControl control = changeControlFactory.validateFor(changeId); change = control.getChange(); patchSetInfo = infoFactory.get(patchSetId); - drafts = db.patchComments().draft(patchSetId, user.getAccountId()).toList(); + drafts = db.patchComments().draftByPatchSetAuthor(patchSetId, user.getAccountId()).toList(); aic.want(change.getOwner()); diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/patch/PatchScriptFactory.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/patch/PatchScriptFactory.java index 9ad8e3aeeb..5a60623828 100644 --- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/patch/PatchScriptFactory.java +++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/patch/PatchScriptFactory.java @@ -287,7 +287,7 @@ class PatchScriptFactory extends Handler { private void loadPublished(final Map byKey, final AccountInfoCacheFactory aic, final String file) throws OrmException { - for (PatchLineComment c : db.patchComments().published(changeId, file)) { + for (PatchLineComment c : db.patchComments().publishedByChangeFile(changeId, file)) { if (comments.include(c)) { aic.want(c.getAuthor()); } @@ -303,7 +303,7 @@ class PatchScriptFactory extends Handler { private void loadDrafts(final Map byKey, final AccountInfoCacheFactory aic, final Account.Id me, final String file) throws OrmException { - for (PatchLineComment c : db.patchComments().draft(changeId, file, me)) { + for (PatchLineComment c : db.patchComments().draftByChangeFileAuthor(changeId, file, me)) { if (comments.include(c)) { aic.want(me); } diff --git a/gerrit-reviewdb/src/main/java/com/google/gerrit/reviewdb/PatchLineCommentAccess.java b/gerrit-reviewdb/src/main/java/com/google/gerrit/reviewdb/PatchLineCommentAccess.java index 26785a8b81..ddff0f19a6 100644 --- a/gerrit-reviewdb/src/main/java/com/google/gerrit/reviewdb/PatchLineCommentAccess.java +++ b/gerrit-reviewdb/src/main/java/com/google/gerrit/reviewdb/PatchLineCommentAccess.java @@ -30,35 +30,39 @@ public interface PatchLineCommentAccess extends @Query("WHERE key.patchKey = ? AND status = '" + PatchLineComment.STATUS_PUBLISHED + "' ORDER BY lineNbr,writtenOn") - ResultSet published(Patch.Key patch) throws OrmException; + ResultSet publishedByPatch(Patch.Key patch) + throws OrmException; @Query("WHERE key.patchKey.patchSetId.changeId = ?" + " AND key.patchKey.fileName = ? AND status = '" + PatchLineComment.STATUS_PUBLISHED + "' ORDER BY lineNbr,writtenOn") - ResultSet published(Change.Id id, String file) + ResultSet publishedByChangeFile(Change.Id id, String file) throws OrmException; @Query("WHERE key.patchKey.patchSetId = ? AND status = '" + PatchLineComment.STATUS_PUBLISHED + "'") - ResultSet published(PatchSet.Id patchset) + ResultSet publishedByPatchSet(PatchSet.Id patchset) throws OrmException; @Query("WHERE key.patchKey.patchSetId = ? AND status = '" + PatchLineComment.STATUS_DRAFT + "' AND author = ? ORDER BY key.patchKey,lineNbr,writtenOn") - ResultSet draft(PatchSet.Id patchset, Account.Id author) + ResultSet draftByPatchSetAuthor + (PatchSet.Id patchset, Account.Id author) throws OrmException; @Query("WHERE key.patchKey = ? AND status = '" + PatchLineComment.STATUS_DRAFT + "' AND author = ? ORDER BY lineNbr,writtenOn") - ResultSet draft(Patch.Key patch, Account.Id author) + ResultSet draftByPatchAuthor + (Patch.Key patch, Account.Id author) throws OrmException; @Query("WHERE key.patchKey.patchSetId.changeId = ?" + " AND key.patchKey.fileName = ? AND author = ? AND status = '" + PatchLineComment.STATUS_DRAFT + "' ORDER BY lineNbr,writtenOn") - ResultSet draft(Change.Id id, String file, Account.Id author) + ResultSet draftByChangeFileAuthor + (Change.Id id, String file, Account.Id author) throws OrmException; @Query("WHERE status = '" + PatchLineComment.STATUS_DRAFT diff --git a/gerrit-reviewdb/src/main/java/com/google/gerrit/reviewdb/ReviewDb.java b/gerrit-reviewdb/src/main/java/com/google/gerrit/reviewdb/ReviewDb.java index b75b91bb1f..08d6783b4b 100644 --- a/gerrit-reviewdb/src/main/java/com/google/gerrit/reviewdb/ReviewDb.java +++ b/gerrit-reviewdb/src/main/java/com/google/gerrit/reviewdb/ReviewDb.java @@ -32,85 +32,85 @@ import com.google.gwtorm.client.Sequence; public interface ReviewDb extends Schema { /* If you change anything, update SchemaVersion.C to use a new version. */ - @Relation + @Relation(id = 1) SchemaVersionAccess schemaVersion(); - @Relation + @Relation(id = 2) SystemConfigAccess systemConfig(); - @Relation + @Relation(id = 3) ApprovalCategoryAccess approvalCategories(); - @Relation + @Relation(id = 4) ApprovalCategoryValueAccess approvalCategoryValues(); - @Relation + @Relation(id = 5) ContributorAgreementAccess contributorAgreements(); - @Relation + @Relation(id = 6) AccountAccess accounts(); - @Relation + @Relation(id = 7) AccountExternalIdAccess accountExternalIds(); - @Relation + @Relation(id = 8) AccountSshKeyAccess accountSshKeys(); - @Relation + @Relation(id = 9) AccountAgreementAccess accountAgreements(); - @Relation + @Relation(id = 10) AccountGroupAccess accountGroups(); - @Relation + @Relation(id = 11) AccountGroupNameAccess accountGroupNames(); - @Relation + @Relation(id = 12) AccountGroupMemberAccess accountGroupMembers(); - @Relation + @Relation(id = 13) AccountGroupMemberAuditAccess accountGroupMembersAudit(); - @Relation + @Relation(id = 14) AccountGroupIncludeAccess accountGroupIncludes(); - @Relation + @Relation(id = 15) AccountGroupIncludeAuditAccess accountGroupIncludesAudit(); - @Relation + @Relation(id = 16) AccountGroupAgreementAccess accountGroupAgreements(); - @Relation + @Relation(id = 17) AccountDiffPreferenceAccess accountDiffPreferences(); - @Relation + @Relation(id = 18) StarredChangeAccess starredChanges(); - @Relation + @Relation(id = 19) AccountProjectWatchAccess accountProjectWatches(); - @Relation + @Relation(id = 20) AccountPatchReviewAccess accountPatchReviews(); - @Relation + @Relation(id = 21) ChangeAccess changes(); - @Relation + @Relation(id = 22) PatchSetApprovalAccess patchSetApprovals(); - @Relation + @Relation(id = 23) ChangeMessageAccess changeMessages(); - @Relation + @Relation(id = 24) PatchSetAccess patchSets(); - @Relation + @Relation(id = 25) PatchSetAncestorAccess patchSetAncestors(); - @Relation + @Relation(id = 26) PatchLineCommentAccess patchComments(); - @Relation + @Relation(id = 27) TrackingIdAccess trackingIds(); /** Create the next unique id for an {@link Account}. */ diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/patch/PublishComments.java b/gerrit-server/src/main/java/com/google/gerrit/server/patch/PublishComments.java index 1d43453684..34194af058 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/patch/PublishComments.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/patch/PublishComments.java @@ -280,7 +280,7 @@ public class PublishComments implements Callable { } private List drafts() throws OrmException { - return db.patchComments().draft(patchSetId, user.getAccountId()).toList(); + return db.patchComments().draftByPatchSetAuthor(patchSetId, user.getAccountId()).toList(); } private void email() { diff --git a/pom.xml b/pom.xml index a984a83bd2..366b6bd280 100644 --- a/pom.xml +++ b/pom.xml @@ -47,7 +47,7 @@ limitations under the License. 1.0.0.201106090707-r.19-g8d88a84 - 1.1.5 + 1.2-SNAPSHOT 1.2.5 1.2.4 2.3.0