View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *     http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package javax.jdo.metadata;
18  
19  import javax.jdo.annotations.ForeignKeyAction;
20  
21  /**
22   * Represents a key in a map.
23   */
24  public interface KeyMetadata extends Metadata {
25      /**
26       * Method to set the column name.
27       * 
28       * @param column Column name
29       */
30      KeyMetadata setColumn(String column);
31  
32      /**
33       * Accessor for the name of the column.
34       * 
35       * @return The name
36       */
37      String getColumn();
38  
39      /**
40       * Method to set the table name.
41       * 
42       * @param table Table name
43       */
44      KeyMetadata setTable(String table);
45  
46      /**
47       * Accessor for the name of the table.
48       * 
49       * @return The name
50       */
51      String getTable();
52  
53      /**
54       * Method to set the delete action of the FK
55       * 
56       * @param action Delete action of the FK
57       */
58      KeyMetadata setDeleteAction(ForeignKeyAction action);
59  
60      /**
61       * Accessor for the delete action of the FK
62       * 
63       * @return The FK delete-action
64       */
65      ForeignKeyAction getDeleteAction();
66  
67      /**
68       * Method to set the update action of the FK
69       * 
70       * @param action Update action of the FK
71       */
72      KeyMetadata setUpdateAction(ForeignKeyAction action);
73  
74      /**
75       * Accessor for the update action of the FK
76       * 
77       * @return The FK update-action
78       */
79      ForeignKeyAction getUpdateAction();
80  
81      /**
82       * Accessor for all column(s) defined on the key.
83       * 
84       * @return The column(s)
85       */
86      ColumnMetadata[] getColumns();
87  
88      /**
89       * Add a new column for this key.
90       * 
91       * @return The ColumnMetadata
92       */
93      ColumnMetadata newColumnMetadata();
94  
95      /**
96       * Accessor for the number of columns defined for this key.
97       * 
98       * @return The number of columns
99       */
100     int getNumberOfColumns();
101 
102     /**
103      * Method to set new embedded metadata for the key.
104      * 
105      * @return The EmbeddedMetadata
106      */
107     EmbeddedMetadata newEmbeddedMetadata();
108 
109     /**
110      * Accessor for any embedded metadata on this key
111      * 
112      * @return The EmbeddedMetadata
113      */
114     EmbeddedMetadata getEmbeddedMetadata();
115 
116     /**
117      * Method to set new index metadata for the key.
118      * 
119      * @return The IndexMetadata
120      */
121     IndexMetadata newIndexMetadata();
122 
123     /**
124      * Accessor for any index metadata on this key
125      * 
126      * @return Index metadata
127      */
128     IndexMetadata getIndexMetadata();
129 
130     /**
131      * Method to set new unique constraint metadata for the key
132      * 
133      * @return The UniqueMetadata
134      */
135     UniqueMetadata newUniqueMetadata();
136 
137     /**
138      * Accessor for any unique constraint metadata on this key.
139      * 
140      * @return The UniqueMetadata
141      */
142     UniqueMetadata getUniqueMetadata();
143 
144     /**
145      * Method to set new foreign key metadata for the key
146      * 
147      * @return The ForeignKeyMetadata
148      */
149     ForeignKeyMetadata newForeignKeyMetadata();
150 
151     /**
152      * Accessor for any foreign key metadata on this key.
153      * 
154      * @return The ForeignKeyMetadata
155      */
156     ForeignKeyMetadata getForeignKeyMetadata();
157 }