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 a unique constraint.
21 * @since 3.0
22 */
23 public interface UniqueMetadata extends Metadata {
24 /**
25 * Method to set the name of the constraint
26 *
27 * @param name Name of the constraint
28 */
29 UniqueMetadata setName(String name);
30
31 /**
32 * Accessor for the constraint name.
33 *
34 * @return The constraint name
35 */
36 String getName();
37
38 /**
39 * Method to set the table name.
40 *
41 * @param table Table name
42 */
43 UniqueMetadata setTable(String table);
44
45 /**
46 * Accessor for the name of the table.
47 *
48 * @return The name
49 */
50 String getTable();
51
52 /**
53 * Method to set whether the constraint is deferred.
54 *
55 * @param def Deferred?
56 */
57 UniqueMetadata setDeferred(boolean def);
58
59 /**
60 * Accessor for whether deferred.
61 *
62 * @return Deferred?
63 */
64 Boolean getDeferred();
65
66 /**
67 * Accessor for all column(s) defined on the unique constraint.
68 *
69 * @return The column(s)
70 */
71 ColumnMetadata[] getColumns();
72
73 /**
74 * Add a new column for this unique constraint.
75 *
76 * @return The ColumnMetadata
77 */
78 ColumnMetadata newColumnMetadata();
79
80 /**
81 * Accessor for the number of columns defined for this unique constraint.
82 *
83 * @return The number of columns
84 */
85 int getNumberOfColumns();
86
87 /**
88 * Accessor for all fields/properties defined on the unique constraint.
89 * @return The members
90 */
91 MemberMetadata[] getMembers();
92
93 /**
94 * Accessor for the number of fields/properties defined for this unique constraint.
95 * @return The number of members
96 */
97 int getNumberOfMembers();
98
99 /**
100 * Add a new field for this unique constraint.
101 *
102 * @param name Name of the field
103 * @return The FieldMetadata
104 */
105 FieldMetadata newFieldMetadata(String name);
106
107 /**
108 * Add a new property for this unique constraint.
109 *
110 * @param name Name of the property
111 * @return The PropertyMetadata
112 */
113 PropertyMetadata newPropertyMetadata(String name);
114 }