Make a magic constant for the Submit approval category

This category has special meaning to Gerrit as it triggers magic
code in the change workflow.

Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
Shawn O. Pearce
2009-01-06 18:45:19 -08:00
parent 402b4eeeba
commit 97a21420c2
3 changed files with 6 additions and 2 deletions

View File

@@ -20,6 +20,10 @@ import com.google.gwtorm.client.StringKey;
/** Types of approvals that can be associated with a {@link Change}. */
public final class ApprovalCategory {
/** Id of the special "Submit" action (and category). */
public static final ApprovalCategory.Id SUBMIT =
new ApprovalCategory.Id("SUBM");
public static class Id extends StringKey<Key<?>> {
@Column(length = 4)
protected String id;

View File

@@ -77,7 +77,7 @@ public class ImportGerrit1 {
try {
verifyCategory = db.approvalCategories().byName("Verified");
approveCategory = db.approvalCategories().byName("Code Review");
submitCategory = db.approvalCategories().byName("Submit");
submitCategory = db.approvalCategories().get(ApprovalCategory.SUBMIT);
final Statement query = sql.createStatement();
java.sql.ResultSet srcs;

View File

@@ -232,7 +232,7 @@ public class GerritServer {
final ApprovalCategory cat;
final ArrayList<ApprovalCategoryValue> vals;
cat = new ApprovalCategory(new ApprovalCategory.Id("SUBM"), "Submit");
cat = new ApprovalCategory(ApprovalCategory.SUBMIT, "Submit");
cat.setPosition((short) -1);
vals = new ArrayList<ApprovalCategoryValue>();
vals.add(value(cat, 1, "Submit"));