blob: d3fd955510601a10bbfbe3454067a1076b8bdcfb [file] [log] [blame]
kmoorec9c9e2b2011-02-06 02:07:28 +00001/*******************************************************************************
bvosburgh91d39dc2011-04-28 02:00:43 +00002 * Copyright (c) 2010, 2011 Oracle. All rights reserved.
kmoorec9c9e2b2011-02-06 02:07:28 +00003 * This program and the accompanying materials are made available under the
4 * terms of the Eclipse Public License v1.0, which accompanies this distribution
5 * and is available at http://www.eclipse.org/legal/epl-v10.html.
6 *
7 * Contributors:
8 * Oracle - initial API and implementation
9 ******************************************************************************/
10package org.eclipse.jpt.jpa.core.internal.jpa2.context.java;
11
kmoorec9c9e2b2011-02-06 02:07:28 +000012import org.eclipse.jdt.core.dom.CompilationUnit;
13import org.eclipse.jpt.common.core.utility.TextRange;
kmoore3d505d22011-08-02 13:24:47 +000014import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
kmoorec9c9e2b2011-02-06 02:07:28 +000015import org.eclipse.jpt.jpa.core.context.ReadOnlyColumn;
16import org.eclipse.jpt.jpa.core.context.java.JavaColumn;
17import org.eclipse.jpt.jpa.core.context.java.JavaMultiRelationshipMapping;
18import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaJpaContextNode;
19import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
20import org.eclipse.jpt.jpa.db.Table;
21
22/**
23 *
24 */
25public class NullJavaMapKeyColumn2_0
26 extends AbstractJavaJpaContextNode
27 implements JavaColumn
28{
29 public NullJavaMapKeyColumn2_0(JavaMultiRelationshipMapping parent) {
30 super(parent);
31 }
32
33
34 // ********** column annotation **********
35
36 public ColumnAnnotation getColumnAnnotation() {
kmoorec7a08672011-08-01 15:10:18 +000037 return (ColumnAnnotation) this.getParent().getPersistentAttribute().getResourceAttribute().getNonNullAnnotation(ColumnAnnotation.ANNOTATION_NAME);
kmoorec9c9e2b2011-02-06 02:07:28 +000038 }
39
40
41 // ********** name **********
42
43 public String getName() {
44 return null;
45 }
46
47 public String getSpecifiedName() {
48 return null;
49 }
50
51 public void setSpecifiedName(String name) {
52 throw new UnsupportedOperationException();
53 }
54
55 public String getDefaultName() {
56 return null;
57 }
58
59
60 // ********** column definition **********
61
62 public String getColumnDefinition() {
63 return null;
64 }
65
66 public void setColumnDefinition(String columnDefinition) {
67 throw new UnsupportedOperationException();
68 }
69
70
71 // ********** table **********
72
73 public String getTable() {
74 return null;
75 }
76
77 public String getSpecifiedTable() {
78 return null;
79 }
80
81 public void setSpecifiedTable(String table) {
82 throw new UnsupportedOperationException();
83 }
84
85 public String getDefaultTable() {
86 return null;
87 }
88
89
90 // ********** unique **********
91
92 public boolean isUnique() {
93 return false;
94 }
95
96 public Boolean getSpecifiedUnique() {
97 return null;
98 }
99
100 public void setSpecifiedUnique(Boolean unique) {
101 throw new UnsupportedOperationException();
102 }
103
104 public boolean isDefaultUnique() {
105 return false;
106 }
107
108
109 // ********** nullable **********
110
111 public boolean isNullable() {
112 return false;
113 }
114
115 public Boolean getSpecifiedNullable() {
116 return null;
117 }
118
119 public void setSpecifiedNullable(Boolean nullable) {
120 throw new UnsupportedOperationException();
121 }
122
123 public boolean isDefaultNullable() {
124 return false;
125 }
126
127
128 // ********** insertable **********
129
130 public boolean isInsertable() {
131 return false;
132 }
133
134 public Boolean getSpecifiedInsertable() {
135 return null;
136 }
137
138 public void setSpecifiedInsertable(Boolean insertable) {
139 throw new UnsupportedOperationException();
140 }
141
142 public boolean isDefaultInsertable() {
143 return false;
144 }
145
146
147 // ********** updatable **********
148
149 public boolean isUpdatable() {
150 return false;
151 }
152
153 public Boolean getSpecifiedUpdatable() {
154 return null;
155 }
156
157 public void setSpecifiedUpdatable(Boolean updatable) {
158 throw new UnsupportedOperationException();
159 }
160
161 public boolean isDefaultUpdatable() {
162 return false;
163 }
164
165
166 // ********** length **********
167
168 public int getLength() {
169 return 0;
170 }
171
172 public Integer getSpecifiedLength() {
173 return null;
174 }
175
176 public void setSpecifiedLength(Integer length) {
177 throw new UnsupportedOperationException();
178 }
179
180 public int getDefaultLength() {
181 return 0;
182 }
183
184
185 // ********** precision **********
186
187 public int getPrecision() {
188 return 0;
189 }
190
191 public Integer getSpecifiedPrecision() {
192 return null;
193 }
194
195 public void setSpecifiedPrecision(Integer precision) {
196 throw new UnsupportedOperationException();
197 }
198
199 public int getDefaultPrecision() {
200 return 0;
201 }
202
203
204 // ********** scale **********
205
206 public int getScale() {
207 return 0;
208 }
209
210 public Integer getSpecifiedScale() {
211 return null;
212 }
213
214 public void setSpecifiedScale(Integer scale) {
215 throw new UnsupportedOperationException();
216 }
217
218 public int getDefaultScale() {
219 return 0;
220 }
221
222
223 // ********** misc **********
224
225 @Override
226 public JavaMultiRelationshipMapping getParent() {
227 return (JavaMultiRelationshipMapping) super.getParent();
228 }
229
230 public void initializeFrom(ReadOnlyColumn oldColumn) {
231 // NOP
232 }
233
234 public void initializeFromVirtual(ReadOnlyColumn virtualColumn) {
235 // NOP
236 }
237
kmoore3d505d22011-08-02 13:24:47 +0000238 public Iterable<String> getCandidateTableNames() {
239 return EmptyIterable.instance();
kmoorec9c9e2b2011-02-06 02:07:28 +0000240 }
241
242
243 // ********** database stuff **********
244
245 public org.eclipse.jpt.jpa.db.Column getDbColumn() {
246 return null;
247 }
248
249 public Table getDbTable() {
250 return null;
251 }
252
253 public boolean isResolved() {
254 return false;
255 }
256
257
258 // ********** validation **********
259
260 public TextRange getValidationTextRange(CompilationUnit astRoot) {
bvosburgh91d39dc2011-04-28 02:00:43 +0000261 return this.getParent().getValidationTextRange(astRoot);
kmoorec9c9e2b2011-02-06 02:07:28 +0000262 }
263
264 public TextRange getNameTextRange(CompilationUnit astRoot) {
bvosburgh91d39dc2011-04-28 02:00:43 +0000265 return this.getValidationTextRange(astRoot);
kmoorec9c9e2b2011-02-06 02:07:28 +0000266 }
267
268 public TextRange getTableTextRange(CompilationUnit astRoot) {
bvosburgh91d39dc2011-04-28 02:00:43 +0000269 return this.getValidationTextRange(astRoot);
kmoorec9c9e2b2011-02-06 02:07:28 +0000270 }
271
272 public boolean tableNameIsInvalid() {
273 return false;
274 }
275}