1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package javax.jdo.metadata;
18
19 import javax.jdo.annotations.IdGeneratorStrategy;
20
21 /**
22 * Represents the datastore identity of a class.
23 * @since 3.0
24 */
25 public interface DatastoreIdentityMetadata extends Metadata {
26 /**
27 * Method to set the datastore identity column name.
28 *
29 * @param column Name of the datastore identity column
30 */
31 DatastoreIdentityMetadata setColumn(String column);
32
33 /**
34 * Accessor for the datastore identity column name
35 *
36 * @return The column name
37 */
38 String getColumn();
39
40 /**
41 * Method to set the identity generation strategy.
42 *
43 * @param strategy The strategy
44 */
45 DatastoreIdentityMetadata setStrategy(IdGeneratorStrategy strategy);
46
47 /**
48 * Accessor for the identity generation strategy.
49 *
50 * @return The strategy
51 */
52 IdGeneratorStrategy getStrategy();
53
54 /**
55 * Method to set the custom identity generation strategy.
56 *
57 * @param strategy The strategy
58 */
59 DatastoreIdentityMetadata setCustomStrategy(String strategy);
60
61 /**
62 * Accessor for the custom strategy (overriding "strategy").
63 *
64 * @return The strategy
65 */
66 String getCustomStrategy();
67
68 /**
69 * Method to set the sequence key (when using "sequence" strategy)
70 *
71 * @param seq Sequence key
72 */
73 DatastoreIdentityMetadata setSequence(String seq);
74
75 /**
76 * Accessor for the sequence key (when using "sequence" strategy)
77 *
78 * @return The sequence
79 */
80 String getSequence();
81
82 /**
83 * Accessor for all column(s) defined on the datastore identity.
84 *
85 * @return The column(s)
86 */
87 ColumnMetadata[] getColumns();
88
89 /**
90 * Add a new column for this datastore identity.
91 *
92 * @return The ColumnMetadata
93 */
94 ColumnMetadata newColumnMetadata();
95
96 /**
97 * Accessor for the number of columns defined for this datastore identity.
98 *
99 * @return The number of columns
100 */
101 int getNumberOfColumns();
102 }