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 join information.
23   * @since 3.0
24   */
25  public interface JoinMetadata extends Metadata {
26      /**
27       * Method to set the join column.
28       * 
29       * @param column Name of the join column
30       */
31      JoinMetadata setColumn(String column);
32  
33      /**
34       * Accessor for the join column name
35       * 
36       * @return The column name
37       */
38      String getColumn();
39  
40      /**
41       * Method to set the table name.
42       * 
43       * @param table Table name
44       */
45      JoinMetadata setTable(String table);
46  
47      /**
48       * Accessor for the name of the table.
49       * 
50       * @return The name
51       */
52      String getTable();
53  
54      /**
55       * Method to set whether to use an outer join
56       * 
57       * @param outer Outer join?
58       */
59      JoinMetadata setOuter(boolean outer);
60  
61      /**
62       * Accessor for whether to use an outer join.
63       * 
64       * @return Outer join?
65       */
66      boolean getOuter();
67  
68      /**
69       * Method to set the delete action of the FK
70       * 
71       * @param action Delete action of the FK
72       */
73      JoinMetadata setDeleteAction(ForeignKeyAction action);
74  
75      /**
76       * Accessor for the delete action of the FK
77       * 
78       * @return The FK delete-action
79       */
80      ForeignKeyAction getDeleteAction();
81  
82      /**
83       * Method to set whether indexed.
84       * 
85       * @param indexed Whether indexed (true | false | unique)
86       */
87      JoinMetadata setIndexed(Indexed indexed);
88  
89      /**
90       * Accessor for whether indexed (true|false|unique)
91       * 
92       * @return Indexed?
93       */
94      Indexed getIndexed();
95  
96      /**
97       * Method to set whether it is unique.
98       * 
99       * @param unique Unique?
100      */
101     JoinMetadata setUnique(boolean unique);
102 
103     /**
104      * Accessor for whether unique.
105      * 
106      * @return Unique?
107      */
108     Boolean getUnique();
109 
110     /**
111      * Method to set new index metadata for the join.
112      * 
113      * @return The IndexMetadata
114      */
115     IndexMetadata newIndexMetadata();
116 
117     /**
118      * Accessor for any index metadata on this join
119      * 
120      * @return Index metadata
121      */
122     IndexMetadata getIndexMetadata();
123 
124     /**
125      * Method to set new unique constraint metadata for the join
126      * 
127      * @return The UniqueMetadata
128      */
129     UniqueMetadata newUniqueMetadata();
130 
131     /**
132      * Accessor for any unique constraint metadata on this join.
133      * 
134      * @return The UniqueMetadata
135      */
136     UniqueMetadata getUniqueMetadata();
137 
138     /**
139      * Method to set new foreign key metadata for the join
140      * 
141      * @return The ForeignKeyMetadata
142      */
143     ForeignKeyMetadata newForeignKeyMetadata();
144 
145     /**
146      * Accessor for any foreign key metadata on this join.
147      * 
148      * @return The ForeignKeyMetadata
149      */
150     ForeignKeyMetadata getForeignKeyMetadata();
151 
152     /**
153      * Method to set new primary key metadata for the join
154      * 
155      * @return The PrimaryKeyMetadata
156      */
157     PrimaryKeyMetadata newPrimaryKeyMetadata();
158 
159     /**
160      * Accessor for any primary key metadata on this join.
161      * 
162      * @return The PrimaryKeyMetadata
163      */
164     PrimaryKeyMetadata getPrimaryKeyMetadata();
165 
166     /**
167      * Accessor for all column(s) defined on the join.
168      * 
169      * @return The column(s)
170      */
171     ColumnMetadata[] getColumns();
172 
173     /**
174      * Add a new column for this join.
175      * 
176      * @return The ColumnMetadata
177      */
178     ColumnMetadata newColumnMetadata();
179 
180     /**
181      * Accessor for the number of columns defined for this join.
182      * 
183      * @return The number of columns
184      */
185     int getNumberOfColumns();
186 }