diff --git a/gerrit-reviewdb/src/main/java/com/google/gerrit/reviewdb/server/ChangeAccess.java b/gerrit-reviewdb/src/main/java/com/google/gerrit/reviewdb/server/ChangeAccess.java index 66df78a5c8..9618bc3d8e 100644 --- a/gerrit-reviewdb/src/main/java/com/google/gerrit/reviewdb/server/ChangeAccess.java +++ b/gerrit-reviewdb/src/main/java/com/google/gerrit/reviewdb/server/ChangeAccess.java @@ -42,12 +42,11 @@ public interface ChangeAccess extends Access { @Query("WHERE dest.projectName = ?") ResultSet byProject(Project.NameKey p) throws OrmException; + @Deprecated @Query("WHERE owner = ? AND open = true ORDER BY createdOn, changeId") ResultSet byOwnerOpen(Account.Id id) throws OrmException; - @Query("WHERE owner = ? AND open = false ORDER BY lastUpdatedOn DESC LIMIT 5") - ResultSet byOwnerClosed(Account.Id id) throws OrmException; - + @Deprecated @Query("WHERE owner = ? AND open = false ORDER BY lastUpdatedOn") ResultSet byOwnerClosedAll(Account.Id id) throws OrmException; @@ -58,9 +57,11 @@ public interface ChangeAccess extends Access { @Query("WHERE status = '" + Change.STATUS_SUBMITTED + "'") ResultSet allSubmitted() throws OrmException; + @Deprecated @Query("WHERE open = true AND sortKey > ? ORDER BY sortKey LIMIT ?") ResultSet allOpenPrev(String sortKey, int limit) throws OrmException; + @Deprecated @Query("WHERE open = true AND sortKey < ? ORDER BY sortKey DESC LIMIT ?") ResultSet allOpenNext(String sortKey, int limit) throws OrmException; @@ -70,6 +71,7 @@ public interface ChangeAccess extends Access { @Query("WHERE open = true AND dest = ?") ResultSet byBranchOpenAll(Branch.NameKey p) throws OrmException; + @Deprecated @Query("WHERE open = true AND dest.projectName = ? AND sortKey > ?" + " ORDER BY sortKey LIMIT ?") ResultSet byProjectOpenPrev(Project.NameKey p, String sortKey, @@ -80,29 +82,35 @@ public interface ChangeAccess extends Access { ResultSet byProjectOpenNext(Project.NameKey p, String sortKey, int limit) throws OrmException; + @Deprecated @Query("WHERE open = false AND status = ? AND dest.projectName = ? AND sortKey > ?" + " ORDER BY sortKey LIMIT ?") ResultSet byProjectClosedPrev(char status, Project.NameKey p, String sortKey, int limit) throws OrmException; + @Deprecated @Query("WHERE open = false AND status = ? AND dest.projectName = ? AND sortKey < ?" + " ORDER BY sortKey DESC LIMIT ?") ResultSet byProjectClosedNext(char status, Project.NameKey p, String sortKey, int limit) throws OrmException; + @Deprecated @Query("WHERE open = false AND status = ? AND sortKey > ? ORDER BY sortKey LIMIT ?") ResultSet allClosedPrev(char status, String sortKey, int limit) throws OrmException; + @Deprecated @Query("WHERE open = false AND status = ? AND sortKey < ? ORDER BY sortKey DESC LIMIT ?") ResultSet allClosedNext(char status, String sortKey, int limit) throws OrmException; + @Deprecated @Query("WHERE open = false AND status = ? AND dest = ? AND sortKey > ?" + " ORDER BY sortKey LIMIT ?") ResultSet byBranchClosedPrev(char status, Branch.NameKey p, String sortKey, int limit) throws OrmException; + @Deprecated @Query("WHERE open = false AND status = ? AND dest = ? AND sortKey < ?" + " ORDER BY sortKey DESC LIMIT ?") ResultSet byBranchClosedNext(char status, Branch.NameKey p, diff --git a/gerrit-reviewdb/src/main/java/com/google/gerrit/reviewdb/server/PatchSetApprovalAccess.java b/gerrit-reviewdb/src/main/java/com/google/gerrit/reviewdb/server/PatchSetApprovalAccess.java index dae8e6d51b..25dfdbd3dd 100644 --- a/gerrit-reviewdb/src/main/java/com/google/gerrit/reviewdb/server/PatchSetApprovalAccess.java +++ b/gerrit-reviewdb/src/main/java/com/google/gerrit/reviewdb/server/PatchSetApprovalAccess.java @@ -39,15 +39,12 @@ public interface PatchSetApprovalAccess extends ResultSet byPatchSetUser(PatchSet.Id patchSet, Account.Id account) throws OrmException; + @Deprecated @Query("WHERE changeOpen = true AND key.accountId = ?") ResultSet openByUser(Account.Id account) throws OrmException; - @Query("WHERE changeOpen = false AND key.accountId = ?" - + " ORDER BY changeSortKey DESC LIMIT 10") - ResultSet closedByUser(Account.Id account) - throws OrmException; - + @Deprecated @Query("WHERE changeOpen = false AND key.accountId = ? ORDER BY changeSortKey") ResultSet closedByUserAll(Account.Id account) throws OrmException; diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/query/change/SqlRewriterImpl.java b/gerrit-server/src/main/java/com/google/gerrit/server/query/change/SqlRewriterImpl.java index 34fe3fb102..c94ee12e5e 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/query/change/SqlRewriterImpl.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/query/change/SqlRewriterImpl.java @@ -81,6 +81,7 @@ public class SqlRewriterImpl extends BasicChangeRewrites @Named("S") final SortKeyPredicate.After s, @Named("L") final IntPredicate l) { return new PaginatedSource(40000, s.getValue(), l.intValue()) { + @SuppressWarnings("deprecation") @Override ResultSet scan(ChangeAccess a, String key, int limit) throws OrmException { @@ -105,6 +106,7 @@ public class SqlRewriterImpl extends BasicChangeRewrites @Named("S") final SortKeyPredicate.Before s, @Named("L") final IntPredicate l) { return new PaginatedSource(40000, s.getValue(), l.intValue()) { + @SuppressWarnings("deprecation") @Override ResultSet scan(ChangeAccess a, String key, int limit) throws OrmException { @@ -128,6 +130,7 @@ public class SqlRewriterImpl extends BasicChangeRewrites @Named("S") final SortKeyPredicate.After s, @Named("L") final IntPredicate l) { return new PaginatedSource(500, s.getValue(), l.intValue()) { + @SuppressWarnings("deprecation") @Override ResultSet scan(ChangeAccess a, String key, int limit) throws OrmException { @@ -170,6 +173,7 @@ public class SqlRewriterImpl extends BasicChangeRewrites @Named("S") final SortKeyPredicate.After s, @Named("L") final IntPredicate l) { return new PaginatedSource(40000, s.getValue(), l.intValue()) { + @SuppressWarnings("deprecation") @Override ResultSet scan(ChangeAccess a, String key, int limit) throws OrmException { @@ -192,6 +196,7 @@ public class SqlRewriterImpl extends BasicChangeRewrites @Named("S") final SortKeyPredicate.Before s, @Named("L") final IntPredicate l) { return new PaginatedSource(40000, s.getValue(), l.intValue()) { + @SuppressWarnings("deprecation") @Override ResultSet scan(ChangeAccess a, String key, int limit) throws OrmException { @@ -214,6 +219,7 @@ public class SqlRewriterImpl extends BasicChangeRewrites @Named("S") final SortKeyPredicate.After s, @Named("L") final IntPredicate l) { return new PaginatedSource(40000, s.getValue(), l.intValue()) { + @SuppressWarnings("deprecation") @Override ResultSet scan(ChangeAccess a, String key, int limit) throws OrmException { @@ -236,6 +242,7 @@ public class SqlRewriterImpl extends BasicChangeRewrites @Named("S") final SortKeyPredicate.Before s, @Named("L") final IntPredicate l) { return new PaginatedSource(40000, s.getValue(), l.intValue()) { + @SuppressWarnings("deprecation") @Override ResultSet scan(ChangeAccess a, String key, int limit) throws OrmException { @@ -257,6 +264,7 @@ public class SqlRewriterImpl extends BasicChangeRewrites @Named("S") final SortKeyPredicate.After s, @Named("L") final IntPredicate l) { return new PaginatedSource(2000, s.getValue(), l.intValue()) { + @SuppressWarnings("deprecation") @Override ResultSet scan(ChangeAccess a, String key, int limit) throws OrmException { @@ -275,6 +283,7 @@ public class SqlRewriterImpl extends BasicChangeRewrites @Named("S") final SortKeyPredicate.Before s, @Named("L") final IntPredicate l) { return new PaginatedSource(2000, s.getValue(), l.intValue()) { + @SuppressWarnings("deprecation") @Override ResultSet scan(ChangeAccess a, String key, int limit) throws OrmException { @@ -298,6 +307,7 @@ public class SqlRewriterImpl extends BasicChangeRewrites init("r20_byMergedPrev", s, l); } + @SuppressWarnings("deprecation") @Override ResultSet scan(ChangeAccess a, String key, int limit) throws OrmException { @@ -322,6 +332,7 @@ public class SqlRewriterImpl extends BasicChangeRewrites init("r20_byMergedNext", s, l); } + @SuppressWarnings("deprecation") @Override ResultSet scan(ChangeAccess a, String key, int limit) throws OrmException { @@ -346,6 +357,7 @@ public class SqlRewriterImpl extends BasicChangeRewrites init("r20_byAbandonedPrev", s, l); } + @SuppressWarnings("deprecation") @Override ResultSet scan(ChangeAccess a, String key, int limit) throws OrmException { @@ -370,6 +382,7 @@ public class SqlRewriterImpl extends BasicChangeRewrites init("r20_byAbandonedNext", s, l); } + @SuppressWarnings("deprecation") @Override ResultSet scan(ChangeAccess a, String key, int limit) throws OrmException { @@ -409,6 +422,7 @@ public class SqlRewriterImpl extends BasicChangeRewrites init("r25_byOwnerOpen", o); } + @SuppressWarnings("deprecation") @Override ResultSet scan(ChangeAccess a) throws OrmException { return a.byOwnerOpen(o.getAccountId()); @@ -430,6 +444,7 @@ public class SqlRewriterImpl extends BasicChangeRewrites init("r25_byOwnerClosed", o); } + @SuppressWarnings("deprecation") @Override ResultSet scan(ChangeAccess a) throws OrmException { return a.byOwnerClosedAll(o.getAccountId()); @@ -457,6 +472,7 @@ public class SqlRewriterImpl extends BasicChangeRewrites init("r30_byReviewerOpen", r); } + @SuppressWarnings("deprecation") @Override public ResultSet read() throws OrmException { return ChangeDataResultSet.patchSetApproval(dbProvider.get() @@ -490,6 +506,7 @@ public class SqlRewriterImpl extends BasicChangeRewrites init("r30_byReviewerClosed", r); } + @SuppressWarnings("deprecation") @Override public ResultSet read() throws OrmException { return ChangeDataResultSet.patchSetApproval(dbProvider.get()