1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package javax.jdo.metadata;
18
19 /**
20 * Represents the primary key definition of a class.
21 * @since 3.0
22 */
23 public interface PrimaryKeyMetadata extends Metadata {
24 /**
25 * Method to set the name of the PK constraint.
26 *
27 * @param name Name of the PK constraint
28 * @return The PK metadata
29 */
30 PrimaryKeyMetadata setName(String name);
31
32 /**
33 * Accessor for the name of the PK constraint.
34 *
35 * @return The PK constraint name
36 */
37 String getName();
38
39 /**
40 * Method to set the PK column name.
41 *
42 * @param column Name of the PK column
43 * @return The PK metadata
44 */
45 PrimaryKeyMetadata setColumn(String column);
46
47 /**
48 * Accessor for the PK column name
49 *
50 * @return The column name
51 */
52 String getColumn();
53
54 /**
55 * Accessor for all column(s) defined on the PK.
56 *
57 * @return The column(s)
58 */
59 ColumnMetadata[] getColumns();
60
61 /**
62 * Add a new column for this PK
63 *
64 * @return The ColumnMetadata
65 */
66 ColumnMetadata newColumnMetadata();
67
68 /**
69 * Accessor for the number of columns defined for this PK
70 *
71 * @return The number of columns
72 */
73 int getNumberOfColumns();
74 }