Added ID to @Relation

In order to support folding all database data into one protobuf type,
we need to tag each relation that needs to be stored with a unique
ID number. That will be used as the ID for the protobuf message
representing that relation.

Change-Id: I6f4a7a24d0c42f37399d82f37f434388aa63710b
diff --git a/src/main/java/com/google/gwtorm/client/Relation.java b/src/main/java/com/google/gwtorm/client/Relation.java
index 97b895e..b6bd0c5 100644
--- a/src/main/java/com/google/gwtorm/client/Relation.java
+++ b/src/main/java/com/google/gwtorm/client/Relation.java
@@ -45,4 +45,11 @@
    * @return the name of the data store table. Defaults to the method name.
    */
   String name() default "";
+
+  /**
+   * @return the unique ID for this relation. Must be unique among all
+   *         relations, and conform to Protobuf message ID rules. The ID must be
+   *         in the range [1,2^29-1] except 19000 through 19999.
+   */
+  int id();
 }
diff --git a/src/test/java/com/google/gwtorm/data/PhoneBookDb.java b/src/test/java/com/google/gwtorm/data/PhoneBookDb.java
index 15439b8..cf6225c 100644
--- a/src/test/java/com/google/gwtorm/data/PhoneBookDb.java
+++ b/src/test/java/com/google/gwtorm/data/PhoneBookDb.java
@@ -19,10 +19,10 @@
 import com.google.gwtorm.client.Sequence;
 
 public interface PhoneBookDb extends Schema {
-  @Relation
+  @Relation(id = 1)
   PersonAccess people();
 
-  @Relation
+  @Relation(id = 2)
   AddressAccess addresses();
 
   @Sequence
diff --git a/src/test/java/com/google/gwtorm/data/PhoneBookDb2.java b/src/test/java/com/google/gwtorm/data/PhoneBookDb2.java
index 908dc92..9b19bc8 100644
--- a/src/test/java/com/google/gwtorm/data/PhoneBookDb2.java
+++ b/src/test/java/com/google/gwtorm/data/PhoneBookDb2.java
@@ -18,6 +18,6 @@
 import com.google.gwtorm.client.Schema;
 
 public interface PhoneBookDb2 extends Schema {
-  @Relation
+  @Relation(id = 1)
   PersonAccess2 people();
 }