Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 337930 | Differences between
and this patch

Collapse All | Expand All

(-)META-INF/MANIFEST.MF (+2 lines)
Lines 25-30 Link Here
25
 org.eclipse.jst.common.project.facet.core;bundle-version="[1.3.100,2.0.0)",
25
 org.eclipse.jst.common.project.facet.core;bundle-version="[1.3.100,2.0.0)",
26
 org.eclipse.jst.j2ee;bundle-version="[1.1.200,2.0.0)",
26
 org.eclipse.jst.j2ee;bundle-version="[1.1.200,2.0.0)",
27
 org.eclipse.jst.j2ee.core;bundle-version="[1.1.200,2.0.0)",
27
 org.eclipse.jst.j2ee.core;bundle-version="[1.1.200,2.0.0)",
28
 org.eclipse.persistence.jpa.jpql;bundle-version="1.0.0",
28
 org.eclipse.wst.common.emf;bundle-version="[1.1.200,2.0.0)",
29
 org.eclipse.wst.common.emf;bundle-version="[1.1.200,2.0.0)",
29
 org.eclipse.wst.common.emfworkbench.integration;bundle-version="[1.1.200,2.0.0)",
30
 org.eclipse.wst.common.emfworkbench.integration;bundle-version="[1.1.200,2.0.0)",
30
 org.eclipse.wst.common.frameworks;bundle-version="[1.1.200,2.0.0)",
31
 org.eclipse.wst.common.frameworks;bundle-version="[1.1.200,2.0.0)",
Lines 62-67 Link Here
62
 org.eclipse.jpt.jpa.core.internal.jpa2.resource.java;x-internal:=true,
63
 org.eclipse.jpt.jpa.core.internal.jpa2.resource.java;x-internal:=true,
63
 org.eclipse.jpt.jpa.core.internal.jpa2.resource.java.binary;x-internal:=true,
64
 org.eclipse.jpt.jpa.core.internal.jpa2.resource.java.binary;x-internal:=true,
64
 org.eclipse.jpt.jpa.core.internal.jpa2.resource.java.source;x-internal:=true,
65
 org.eclipse.jpt.jpa.core.internal.jpa2.resource.java.source;x-internal:=true,
66
 org.eclipse.jpt.jpa.core.internal.jpql;x-friends:="org.eclipse.jpt.jpa.ui",
65
 org.eclipse.jpt.jpa.core.internal.libprov;x-internal:=true,
67
 org.eclipse.jpt.jpa.core.internal.libprov;x-internal:=true,
66
 org.eclipse.jpt.jpa.core.internal.libval;x-internal:=true,
68
 org.eclipse.jpt.jpa.core.internal.libval;x-internal:=true,
67
 org.eclipse.jpt.jpa.core.internal.operations;x-internal:=true,
69
 org.eclipse.jpt.jpa.core.internal.operations;x-internal:=true,
(-)property_files/jpa_jpql_validation.properties (+481 lines)
Added Link Here
1
################################################################################
2
# Copyright (c) 2011 Oracle. All rights reserved.
3
# 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
################################################################################
10
11
// AbsExpression - Grammar
12
ABS_EXPRESSION_INVALID_EXPRESSION = The encapsulated expression is not a valid expression.
13
ABS_EXPRESSION_MISSING_EXPRESSION = The encapsulated expression must be provided for an ABS expression.
14
ABS_EXPRESSION_MISSING_LEFT_PARENTHESIS = The left parenthesis is missing from the ABS expression.
15
ABS_EXPRESSION_MISSING_RIGHT_PARENTHESIS = The right parenthesis is missing from the ABS expression.
16
// AbsExpression - Semantic
17
ABS_EXPRESSION_INVALID_NUMERIC_EXPRESSION = The encapsulated expression is not a valid numeric expression.
18
19
// AbstractFromClause - Grammar
20
ABSTRACT_FROM_CLAUSE_IDENTIFICATION_VARIABLE_DECLARATION_ENDS_WITH_COMMA = The FROM clause cannot end with a comma.
21
ABSTRACT_FROM_CLAUSE_IDENTIFICATION_VARIABLE_DECLARATION_IS_MISSING_COMMA = The FROM clause has ''{0}'' and ''{1}'' that are not separated by a comma.
22
ABSTRACT_FROM_CLAUSE_MISSING_IDENTIFICATION_VARIABLE_DECLARATION = The FROM clause must defined at least one identification variable declaration.
23
ABSTRACT_FROM_CLAUSE_WRONG_ORDER_OF_IDENTIFICATION_VARIABLE_DECLARATION = The identification variable ''{0}'' is declared after its usage. Identification variables are evaluated from left to right.
24
25
// AbstractPathExpression - Grammar
26
ABSTRACT_PATH_EXPRESSION_CANNOT_END_WITH_COMMA = A path expression cannot end with a comma.
27
ABSTRACT_PATH_EXPRESSION_MISSING_IDENTIFICATION_VARIABLE = A path expression must start with an identification variable.
28
29
// AbstractSchemaName - Grammar
30
ABSTRACT_SCHEMA_NAME_INVALID = The abstract schema type ''{0}'' is unknown.
31
ABSTRACT_SCHEMA_NAME_NOT_RESOLVABLE = ''{0}'' cannot be resolved to a type.
32
// AbstractSchemaName - Semantic
33
PATH_EXPRESSION_NOT_RELATIONSHIP_MAPPING = The derived path ''{0}'' does not represent an association field.
34
35
// AbstractSelectClause - Grammar
36
ABSTRACT_SELECT_CLAUSE_SELECT_EXPRESSION_ENDS_WITH_COMMA = The select expression cannot end with a comma.
37
ABSTRACT_SELECT_CLAUSE_SELECT_EXPRESSION_IS_MISSING_COMMA = The SELECT clause has ''{0}'' and ''{1}'' that are not separated by a comma.
38
ABSTRACT_SELECT_CLAUSE_SELECT_EXPRESSION_MALFORMED = The select expression is malformed.
39
ABSTRACT_SELECT_CLAUSE_SELECT_MISSING_EXPRESSION = The select expression is missing from the SELECT clause.
40
41
// AbstractSelectStatement - Grammar
42
ABSTRACT_SELECT_STATEMENT_FROM_CLAUSE_MSSING = A select statement must have a FROM clause.
43
44
// AdditionExpression - Semantic
45
ADDITION_EXPRESSION_LEFT_EXPRESSION_WRONG_TYPE = The left side of the addition is not a valid arithmetic expression.
46
ADDITION_EXPRESSION_RIGHT_EXPRESSION_WRONG_TYPE = The right side of the addition is not a valid arithmetic expression.
47
48
// AllOrAnyExpression - Grammar
49
ALL_OR_ANY_EXPRESSION_INVALID_EXPRESSION = The encapsulated expression is not a valid expression.
50
ALL_OR_ANY_EXPRESSION_MISSING_EXPRESSION = The subquery must be provided for an {0} expression.
51
ALL_OR_ANY_EXPRESSION_MISSING_LEFT_PARENTHESIS = The left parenthesis is missing from the {0} expression.
52
ALL_OR_ANY_EXPRESSION_MISSING_RIGHT_PARENTHESIS = The right parenthesis is missing from the {0} expression.
53
ALL_OR_ANY_EXPRESSION_NOT_PART_OF_COMPARISON_EXPRESSION = The {0} expression must be part of a comparison expression.
54
55
// ArithmeticFactor - Grammar
56
ARITHMETIC_FACTOR_MISSING_EXPRESSION = An arithmetic factor must be followed by an expression.
57
// ArithmeticFactor - Semantic
58
ARITHMETIC_FACTOR_INVALID_EXPRESSION = The expression must be an arithmetic expression.
59
60
// ArithmeticExpression - Grammar
61
ARITHMETIC_EXPRESSION_INVALID_LEFT_EXPRESSION = The left expression is not an arithmetic expression.
62
ARITHMETIC_EXPRESSION_INVALID_RIGHT_EXPRESSION = The right expression is not an arithmetic expression.
63
ARITHMETIC_EXPRESSION_MISSING_LEFT_EXPRESSION = The left expression is missing from the arithmetic expression.
64
ARITHMETIC_EXPRESSION_MISSING_RIGHT_EXPRESSION = The right expression is missing from the arithmetic expression.
65
66
// AvgFunction - Grammar
67
AVG_FUNCTION_INVALID_EXPRESSION = The encapsulated expression is not a valid expression.
68
AVG_FUNCTION_MISSING_LEFT_PARENTHESIS = The left parenthesis is missing from the AVG expression.
69
AVG_FUNCTION_MISSING_EXPRESSION = The encapsulated expression must be provided for an AVG expression.
70
AVG_FUNCTION_MISSING_RIGHT_PARENTHESIS = The right parenthesis is missing from the AVG expression.
71
// AvgFunction - Semantic
72
AVG_FUNCTION_INVALID_NUMERIC_EXPRESSION = The encapsulated expression is not a valid numeric expression.
73
74
// BetweenExpression - Grammar
75
BETWEEN_EXPRESSION_MISSING_EXPRESSION = The result expression is missing from the BETWEEN expression.
76
BETWEEN_EXPRESSION_MISSING_LOWER_BOUND_EXPRESSION = The lower bound expression is missing from the BETWEEN expression.
77
BETWEEN_EXPRESSION_MISSING_AND = The identifier AND is missing from the BETWEEN expression.
78
BETWEEN_EXPRESSION_MISSING_UPPER_BOUND_EXPRESSION = The upper bound expression is missing from the BETWEEN expression.
79
// BetweenExpression - Semantic
80
BETWEEN_EXPRESSION_WRONG_TYPE = The expression's type and the lower and upper bound expressions' type have to be the same type.
81
82
// CaseExpression - Grammar
83
CASE_EXPRESSION_MISSING_ELSE_EXPRESSION = A CASE expression must have an ELSE expression.
84
CASE_EXPRESSION_MISSING_ELSE_IDENTIFIER = The identifier ELSE is missing from the CASE expression.
85
CASE_EXPRESSION_MISSING_END_IDENTIFIER = The identifier END is missing from the CASE expression.
86
CASE_EXPRESSION_MISSING_WHEN_CLAUSE = A CASE expression must define at least one WHEN clause.
87
CASE_EXPRESSION_WHEN_CLAUSES_END_WITH_COMMA = The WHEN clauses cannot end with a comma.
88
CASE_EXPRESSION_WHEN_CLAUSES_HAS_COMMA = Two WHEN clauses cannot be separated by a comma.
89
90
// CoalesceExpression - Grammar
91
COALESCE_EXPRESSION_INVALID_EXPRESSION = The encapsulated expression is not a valid expression.
92
COALESCE_EXPRESSION_MISSING_EXPRESSION = The encapsulated expressions must be provided for a COALESCE expression.
93
COALESCE_EXPRESSION_MISSING_LEFT_PARENTHESIS = The left parenthesis is missing from the COALESCE expression.
94
COALESCE_EXPRESSION_MISSING_RIGHT_PARENTHESIS = The right parenthesis is missing from the COALESCE expression.
95
96
// CollectionMemberExpression - Grammar
97
COLLECTION_MEMBER_EXPRESSION_MISSING_ENTITY_EXPRESSION = A collection member expression must define an entity expression.
98
COLLECTION_MEMBER_EXPRESSION_MISSING_COLLECTION_VALUED_PATH_EXPRESSION = A collection member expression must define a collection valued path expression.
99
// CollectionMemberExpression - Semantic
100
COLLECTION_MEMBER_EXPRESSION_EMBEDDABLE = An embeddable type is not supported.
101
102
// CollectionMemberDeclaration - Grammar
103
COLLECTION_MEMBER_DECLARATION_MISSING_COLLECTION_VALUED_PATH_EXPRESSION = The collection-valued path expression is missing from the collection member declaration.
104
COLLECTION_MEMBER_DECLARATION_MISSING_LEFT_PARENTHESIS = The left parenthesis is missing from the collection member declaration.
105
COLLECTION_MEMBER_DECLARATION_MISSING_IDENTIFICATION_VARIABLE = An identification variable must be specified for a collection member declaration.
106
COLLECTION_MEMBER_DECLARATION_MISSING_RIGHT_PARENTHESIS = The right parenthesis is missing from the collection member declaration.
107
108
// CollectionValuedPathExpression - Semantic
109
COLLECTION_VALUED_PATH_EXPRESSION_NOT_RESOLVABLE" ,     "The collection-valued path ''{0}'' cannot be resolved to a valid association field.
110
COLLECTION_VALUED_PATH_EXPRESSION_NOT_COLLECTION_TYPE = The collection-valued path ''{0}'' must resolve to an association field.
111
112
// ComparisonExpression - Grammar
113
COMPARISON_EXPRESSION_MISSING_LEFT_EXPRESSION = A comparison expression must define the left side of the comparison.
114
COMPARISON_EXPRESSION_MISSING_RIGHT_EXPRESSION = A comparison expression must define the right side of the comparison.
115
// ComparisonExpression - Semantic
116
COMPARISON_EXPRESSION_WRONG_COMPARISON_TYPE = The left and right expressions' type must be of the same type.
117
118
// ConcatExpression - Grammar
119
CONCAT_EXPRESSION_INVALID_EXPRESSION = The expression ''{0}'' is not valid expression.
120
CONCAT_EXPRESSION_MISSING_EXPRESSION = The encapsulated expression is missing from the CONCAT expression.
121
CONCAT_EXPRESSION_MISSING_LEFT_PARENTHESIS = The left parenthesis is missing from the CONCAT expression.
122
CONCAT_EXPRESSION_MISSING_RIGHT_PARENTHESIS = The right parenthesis is missing from the CONCAT expression.
123
// ConcatExpression - Semantic
124
CONCAT_EXPRESSION_EXPRESSION_WRONG_TYPE = The expression ''{0}'' is not a String.
125
126
// ConstructorExpression - Grammar
127
CONSTRUCTOR_EXPRESSION_CONSTRUCTOR_ITEM_ENDS_WITH_COMMA = The constructor items cannot end with a comma.
128
CONSTRUCTOR_EXPRESSION_CONSTRUCTOR_ITEM_IS_MISSING_COMMA = The constructor expression has two constructor items (''{0}'' and ''{1}'') that are not separated by a comma.
129
CONSTRUCTOR_EXPRESSION_MISSING_CONSTRUCTOR_ITEM = A constructor expression must define at least one constructor item.
130
CONSTRUCTOR_EXPRESSION_MISSING_CONSTRUCTOR_NAME = The fully qualified class name must be specified.
131
CONSTRUCTOR_EXPRESSION_MISSING_LEFT_PARENTHESIS = The left parenthesis is missing from the constructor expression.
132
CONSTRUCTOR_EXPRESSION_MISSING_RIGHT_PARENTHESIS = The right parenthesis is missing from the constructor expression.
133
// ConstructorExpression - Semantic
134
CONSTRUCTOR_EXPRESSION_MISMATCHED_PARAMETER_TYPES = No constructors can be found that match the argument types.
135
CONSTRUCTOR_EXPRESSION_UNKNOWN_TYPE = ''{0}'' cannot be resolved to a type.
136
137
// CountFunction - Grammar
138
COUNT_FUNCTION_INVALID_EXPRESSION = The encapsulated expression is not a valid expression.
139
COUNT_FUNCTION_MISSING_EXPRESSION = The encapsulated expression must be provided for a COUNT expression.
140
COUNT_FUNCTION_MISSING_LEFT_PARENTHESIS = The left parenthesis is missing from the COUNT expression.
141
COUNT_FUNCTION_MISSING_RIGHT_PARENTHESIS = The right parenthesis is missing from the COUNT expression.
142
// CountFunction - Semantic
143
COUNT_FUNCTION_DISTINCT_EMBEDDABLE = The use of DISTINCT is not supported for arguments of embeddable types.
144
145
// DateTime - Grammar
146
DATE_TIME_JDBC_ESCAPE_FORMAT_INVALID_SPECIFICATION = The JDBC escape format does not start with either 'd', 't' or 'ts'.
147
DATE_TIME_JDBC_ESCAPE_FORMAT_MISSING_CLOSE_QUOTE = The JDBC escape format is missing the close quote.
148
DATE_TIME_JDBC_ESCAPE_FORMAT_MISSING_OPEN_QUOTE = The JDBC escape format is missing the open quote.
149
DATE_TIME_JDBC_ESCAPE_FORMAT_MISSING_RIGHT_CURLY_BRACE = The JDBC escape format is missing the right curly brace.
150
151
// DeleteClause - Grammar
152
DELETE_CLAUSE_FROM_MISSING = The identifier FROM is missing from the DELETE FROM clause.
153
DELETE_CLAUSE_MULTIPLE_RANGE_VARIABLE_DECLARATION = Only one entity abstract schema type can be defined.
154
DELETE_CLAUSE_RANGE_VARIABLE_DECLARATION_MALFORMED = The entity abstract schema type declaration is malformed.
155
DELETE_CLAUSE_RANGE_VARIABLE_DECLARATION_MISSING = A DELETE clause must define an entity abstract schema type.
156
157
// DivisionExpression - Semantic
158
DIVISION_EXPRESSION_LEFT_EXPRESSION_WRONG_TYPE = The left side of the division is not a valid arithmetic expression.
159
DIVISION_EXPRESSION_RIGHT_EXPRESSION_WRONG_TYPE = The right side of the division is not a valid arithmetic expression.
160
161
// EclipseLinkQueryBuilder - Validation
162
ECLIPSE_LINK_QUERY_BUILDER_GRAMMAR_VALIDATOR_ERROR_MESSAGE = Syntax error parsing the query [{0}]. {1}
163
ECLIPSE_LINK_QUERY_BUILDER_SEMANTIC_VALIDATOR_ERROR_MESSAGE = Problem compiling the query [{0}]. {1}
164
165
// EncapsulatedIdentificationVariableExpression - Semantic
166
ENCAPSULATED_IDENTIFICATION_VARIABLE_EXPRESSION_NOT_MAP_VALUED = The {0} operator may only be applied to identification variables that correspond to map-valued associations or map-valued element collections.
167
168
// EmptyCollectionComparisonExpression - Grammar
169
EMPTY_COLLECTION_COMPARISON_EXPRESSION_MISSING_EXPRESSION = The collection valued path expression must be defined.
170
171
// EntityTypeLiteral - Semantic
172
ENTITY_TYPE_LITERAL_NOT_RESOLVABLE = ''{0}'' cannot be resolved to a type.
173
174
// EntryExpression - Grammar
175
ENTRY_EXPRESSION_INVALID_EXPRESSION = The encapsulated expression is not a valid expression.
176
ENTRY_EXPRESSION_MISSING_EXPRESSION = An identification variable must be provided for an ENTRY expression.
177
ENTRY_EXPRESSION_MISSING_LEFT_PARENTHESIS = The left parenthesis is missing from the ENTRY expression.
178
ENTRY_EXPRESSION_MISSING_RIGHT_PARENTHESIS = The right parenthesis is missing from the ENTRY expression.
179
180
// ExistsExpression - Grammar
181
EXISTS_EXPRESSION_INVALID_EXPRESSION = The encapsulated expression is not a valid expression.
182
EXISTS_EXPRESSION_MISSING_EXPRESSION = A subquery must be provided for an EXISTS expression.
183
EXISTS_EXPRESSION_MISSING_LEFT_PARENTHESIS = The left parenthesis is missing from the EXISTS expression.
184
EXISTS_EXPRESSION_MISSING_RIGHT_PARENTHESIS = The right parenthesis is missing from the EXISTS expression.
185
186
// FuncExpression - Grammar
187
FUNC_EXPRESSION_MISSING_FUNCTION_NAME = The SQL function name must be specified.
188
FUNC_EXPRESSION_MISSING_LEFT_PARENTHESIS = The left parenthesis is missing from the FUNC expression.
189
FUNC_EXPRESSION_MISSING_RIGHT_PARENTHESIS = The right parenthesis is missing from the FUNC expression.
190
191
// GroupByClause - Grammar
192
GROUP_BY_CLAUSE_GROUP_BY_ITEM_ENDS_WITH_COMMA = The select expression cannot end with a comma.
193
GROUP_BY_CLAUSE_GROUP_BY_ITEM_IS_MISSING_COMMA = The GROUP BY clause has ''{0}'' and ''{1}'' that are not separated by a comma.
194
GROUP_BY_CLAUSE_GROUP_BY_ITEM_MISSING = The grouping item is missing from the GROUP BY clause.
195
196
// HavingClause - Grammar
197
HAVING_CLAUSE_INVALID_CONDITIONAL_EXPRESSION = The expression is not a valid conditional expression.
198
HAVING_CLAUSE_MISSING_CONDITIONAL_EXPRESSION = The conditional expression is missing from the HAVING clause.
199
200
// IdentificationVariable - Grammar
201
IDENTIFICATION_VARIABLE_INVALID_DUPLICATE = The identification variable ''{0}'' cannot be declared more than once.
202
IDENTIFICATION_VARIABLE_INVALID_JAVA_IDENTIFIER = The identification variable ''{0}'' is not following the rules for a Java identifier.
203
IDENTIFICATION_VARIABLE_INVALID_RESERVED_WORD = The identification variable ''{0}'' cannot be a reserved word.
204
// IdentificationVariable - Semantic
205
IDENTIFICATION_VARIABLE_ENTITY_NAME = An identification variable must not have the same name as any entity in the same persistence unit.
206
IDENTIFICATION_VARIABLE_INVALID_NOT_DECLARED = The identification variable ''{0}'' is not defined in the FROM clause.
207
208
// IdentificationVariableDeclaration - Grammar
209
IDENTIFICATION_VARIABLE_DECLARATION_MISSING_RANGE_VARIABLE_DECLARATION = The range variable declaration must be specified.
210
211
// IndexExpression - Grammar
212
INDEX_EXPRESSION_INVALID_EXPRESSION = The encapsulated expression is not a valid expression.
213
INDEX_EXPRESSION_MISSING_EXPRESSION = An identification variable must be provided for an INDEX expression.
214
INDEX_EXPRESSION_MISSING_LEFT_PARENTHESIS = The left parenthesis is missing from the INDEX expression.
215
INDEX_EXPRESSION_MISSING_RIGHT_PARENTHESIS = The right parenthesis is missing from the INDEX expression.
216
// IndexExpression - Semantic
217
INDEX_EXPRESSION_WRONG_VARIABLE = The identification variable ''{0}'' does not represent an association or element collection.
218
219
// InExpression - Grammar
220
IN_EXPRESSION_IN_ITEM_ENDS_WITH_COMMA = The items cannot end with a comma.
221
IN_EXPRESSION_IN_ITEM_IS_MISSING_COMMA = The IN expression has ''{0}'' and ''{1}'' that are not separated by a comma.
222
IN_EXPRESSION_MALFORMED_EXPRESSION = The IN expression does not have a valid state field path expression or TYPE expession.
223
IN_EXPRESSION_MISSING_IN_ITEMS = A least one item must be defined for the IN expression.
224
IN_EXPRESSION_MISSING_LEFT_PARENTHESIS = The left parenthesis is missing from the IN expression.
225
IN_EXPRESSION_MISSING_RIGHT_PARENTHESIS = The right parenthesis is missing from the IN expression.
226
IN_EXPRESSION_MISSING_EXPRESSION = A state field path expression or TYPE expression must be defined.
227
228
// InputParameter - Grammar
229
INPUT_PARAMETER_JAVA_IDENTIFIER = The named input parameter ''{0}'' is not following the rules for a Java identifier.
230
INPUT_PARAMETER_MISSING_PARAMETER = The parameter value is missing from the input parameter.
231
INPUT_PARAMETER_MIXTURE = Named and positional input parameters must not be mixed in a single query.
232
INPUT_PARAMETER_NOT_INTEGER = The positional input parameter ''{0}'' cannot use non-Integer characters.
233
INPUT_PARAMETER_SMALLER_THAN_ONE = The number used for the positional input parameter ''{0}'' must be greater than 0.
234
INPUT_PARAMETER_WRONG_CLAUSE_DECLARATION = Input parameters can only be used in the WHERE clause or HAVING clause of a query.
235
236
// Join - Grammar
237
JOIN_MISSING_IDENTIFICATION_VARIABLE = An identification variable must be defined for a JOIN expression.
238
JOIN_MISSING_JOIN_ASSOCIATION_PATH = The join association path is missing from the JOIN expression.
239
240
// JoinFetch - Grammar
241
JOIN_FETCH_MISSING_JOIN_ASSOCIATION_PATH = The join association path is missing from the JOIN FETCH expression.
242
JOIN_FETCH_WRONG_CLAUSE_DECLARATION = JOIN FETCH expressions cannot be used in a FROM clause of a subquery.
243
244
// JPQLExpression - Grammar
245
JPQL_EXPRESSION_INVALID_QUERY = The query does not start with a valid identifier, has to be either SELECT, UPDATE or DELETE FROM.
246
JPQL_EXPRESSION_UNKNOWN_ENDING = The query contains a malformed ending.
247
248
// KeyExpression - Grammar
249
KEY_EXPRESSION_INVALID_EXPRESSION = The encapsulated expression is not a valid expression.
250
KEY_EXPRESSION_MISSING_EXPRESSION = The identification variable must be provided for an ABS expression.
251
KEY_EXPRESSION_MISSING_LEFT_PARENTHESIS = The left parenthesis is missing from the ABS expression.
252
KEY_EXPRESSION_MISSING_RIGHT_PARENTHESIS = The right parenthesis is missing from the ABS expression.
253
254
// LengthExpression - Grammar
255
LENGTH_EXPRESSION_INVALID_EXPRESSION = The encapsulated expression is not a valid expression.
256
LENGTH_EXPRESSION_MISSING_EXPRESSION = An expression must be provided for a LENGTH expression.
257
LENGTH_EXPRESSION_MISSING_LEFT_PARENTHESIS = The left parenthesis is missing from the LENGTH expression.
258
LENGTH_EXPRESSION_MISSING_RIGHT_PARENTHESIS = The right parenthesis is missing from the LENGTH expression.
259
// LikeExpression - Semantic
260
LENGTH_EXPRESSION_WRONG_TYPE = The encapsulated expression is not of string type.
261
262
// LikeExpression - Grammar
263
LIKE_EXPRESSION_INVALID_ESCAPE_CHARACTER = {0} is not a valid escape character.
264
LIKE_EXPRESSION_MISSING_ESCAPE_CHARACTER = The escape character is missing from the LIKE expression.
265
LIKE_EXPRESSION_MISSING_PATTERN_VALUE = The pattern value is missing from the LIKE expression.
266
LIKE_EXPRESSION_MISSING_STRING_EXPRESSION = The string expression is missing from the LIKE expression.
267
268
// LocateExpression - Grammar
269
LOCATE_EXPRESSION_INVALID_FIRST_EXPRESSION = The first argument is not a valid expression.
270
LOCATE_EXPRESSION_INVALID_SECOND_EXPRESSION = The second argument is not a valid expression.
271
LOCATE_EXPRESSION_INVALID_THIRD_EXPRESSION = The third argument is not a valid expression.
272
LOCATE_EXPRESSION_MISSING_FIRST_EXPRESSION = The first argument is missing from the LOCATE expression.
273
LOCATE_EXPRESSION_MISSING_LEFT_PARENTHESIS = The left parenthesis is missing from the LOCATE expression.
274
LOCATE_EXPRESSION_MISSING_FIRST_COMMA = The first comma is missing from the LOCATE expression.
275
LOCATE_EXPRESSION_MISSING_RIGHT_PARENTHESIS = The right parenthesis is missing from the LOCATE expression.
276
LOCATE_EXPRESSION_MISSING_SECOND_COMMA = The second comma is missing from the LOCATE expression.
277
LOCATE_EXPRESSION_MISSING_SECOND_EXPRESSION = The second argument is missing from the LOCATE expression.
278
LOCATE_EXPRESSION_MISSING_THIRD_EXPRESSION = The third argument is missing from the LOCATE expression.
279
// LocateExpression - Semantic
280
LOCATE_EXPRESSION_FIRST_EXPRESSION_WRONG_TYPE = The first expression is not of string type.
281
LOCATE_EXPRESSION_SECOND_EXPRESSION_WRONG_TYPE = The second expression is not of string type.
282
LOCATE_EXPRESSION_THIRD_EXPRESSION_WRONG_TYPE = The third encapsulated expression is not of numeric type.
283
284
// LogicalExpression - Grammar
285
LOGICAL_EXPRESSION_INVALID_LEFT_EXPRESSION = The left expression is missing from the logical expression.
286
LOGICAL_EXPRESSION_INVALID_RIGHT_EXPRESSION = The right expression is missing from the logical expression.
287
LOGICAL_EXPRESSION_MISSING_LEFT_EXPRESSION = The left expression is not a valid expression.
288
LOGICAL_EXPRESSION_MISSING_RIGHT_EXPRESSION = The right expression is not a valid expression.
289
290
// LowerExpression - Grammar
291
LOWER_EXPRESSION_INVALID_EXPRESSION = The encapsulated expression is not a valid expression.
292
LOWER_EXPRESSION_MISSING_EXPRESSION = An expression must be provided for a LOWER expression.
293
LOWER_EXPRESSION_MISSING_LEFT_PARENTHESIS = The left parenthesis is missing from the LOWER expression.
294
LOWER_EXPRESSION_MISSING_RIGHT_PARENTHESIS = The right parenthesis is missing from the LOWER expression.
295
// UpperExpression - Semantic
296
LOWER_EXPRESSION_WRONG_TYPE = The expression is not a String.
297
298
// MaxFunction - Grammar
299
MAX_FUNCTION_INVALID_EXPRESSION = The encapsulated expression is not a valid expression.
300
MAX_FUNCTION_MISSING_EXPRESSION = The encapsulated expression must be provided for a MAX expression.
301
MAX_FUNCTION_MISSING_LEFT_PARENTHESIS = The left parenthesis is missing from the MAX expression.
302
MAX_FUNCTION_MISSING_RIGHT_PARENTHESIS = The right parenthesis is missing from the MAX expression.
303
304
// MinFunction - Grammar
305
MIN_FUNCTION_INVALID_EXPRESSION = The encapsulated expression is not a valid expression.
306
MIN_FUNCTION_MISSING_EXPRESSION = The encapsulated expression must be provided for a MIN expression.
307
MIN_FUNCTION_MISSING_LEFT_PARENTHESIS = The left parenthesis is missing from the MIN expression.
308
MIN_FUNCTION_MISSING_RIGHT_PARENTHESIS = The right parenthesis is missing from the MIN expression.
309
310
// ModExpression - Grammar
311
MOD_EXPRESSION_INVALID_FIRST_EXPRESSION = The first argument is not a valid expression.
312
MOD_EXPRESSION_INVALID_SECOND_PARENTHESIS = The second argument is not a valid expression.
313
MOD_EXPRESSION_MISSING_COMMA = The comma is missing from the MOD expression.
314
MOD_EXPRESSION_MISSING_FIRST_EXPRESSION = The first argument is missing from the MOD expression.
315
MOD_EXPRESSION_MISSING_LEFT_PARENTHESIS = The left parenthesis is missing from the MOD expression.
316
MOD_EXPRESSION_MISSING_RIGHT_PARENTHESIS = The right parenthesis is missing from the MOD expression.
317
MOD_EXPRESSION_MISSING_SECOND_EXPRESSION = The second argument is missing from the MOD expression.
318
// ModExpression - Semantic
319
MOD_EXPRESSION_FIRST_EXPRESSION_WRONG_TYPE = The first expression is not an Integer.
320
MOD_EXPRESSION_SECOND_EXPRESSION_WRONG_TYPE = The second expression is not an Integer.
321
322
// MultiplicationExpression - Semantic
323
MULTIPLICATION_EXPRESSION_LEFT_EXPRESSION_WRONG_TYPE = The left side of the multiplication is not a valid arithmetic expression.
324
MULTIPLICATION_EXPRESSION_RIGHT_EXPRESSION_WRONG_TYPE = The right side of the multiplication is not a valid arithmetic expression.
325
326
// NotExpression - Grammar
327
NOT_EXPRESSION_MISSING_EXPRESSION = The expression is missing after the identifier NOT.
328
// NotExpression - Semantic
329
NOT_EXPRESSION_WRONG_TYPE = The expression is not of boolean type.
330
331
// NullComparisonExpression - Grammar
332
NULL_COMPARISON_EXPRESSION_MISSING_EXPRESSION = The expression is missing from the null comparison expression.
333
// NullComparisonExpression - Semantic
334
NULL_COMPARISON_EXPRESSION_INVALID_COLLECTION_EXPRESSION = ''{0}'' cannot be resolved to a collection type.
335
336
// NullIfExpression - Grammar
337
NULL_IF_EXPRESSION_INVALID_FIRST_EXPRESSION = The first argument is not a valid expression.
338
NULL_IF_EXPRESSION_INVALID_SECOND_EXPRESSION = The second argument is not a valid expression.
339
NULL_IF_EXPRESSION_MISSING_COMMA = The comma is missing from the NULLIF expression.
340
NULL_IF_EXPRESSION_MISSING_FIRST_EXPRESSION = The first argument is missing from the NULLIF expression.
341
NULL_IF_EXPRESSION_MISSING_LEFT_PARENTHESIS = The left parenthesis is missing from the NULLIF expression.
342
NULL_IF_EXPRESSION_MISSING_RIGHT_PARENTHESIS = The right parenthesis is missing from the NULLIF expression.
343
NULL_IF_EXPRESSION_MISSING_SECOND_EXPRESSION = The second argument is missing from the NULLIF expression.
344
345
// NumericLiteral - Grammar
346
NUMERIC_LITERAL_INVALID = ''{0}'' is not a valid numeric value.
347
348
// ObjectByItem - Grammar
349
ORDER_BY_ITEM_INVALID_PATH = ''{0}'' is not a valid state field path expression.
350
ORDER_BY_ITEM_MISSING_STATE_FIELD_PATH_EXPRESSION = A state field path expression must be specified.
351
352
// ObjectExpression - Grammar
353
OBJECT_EXPRESSION_INVALID_EXPRESSION = The encapsulated expression is not a valid expression.
354
OBJECT_EXPRESSION_MISSING_EXPRESSION = An identification variable must be provided for an OBJECT expression.
355
OBJECT_EXPRESSION_MISSING_LEFT_PARENTHESIS = The left parenthesis is missing from the OBJECT expression.
356
OBJECT_EXPRESSION_MISSING_RIGHT_PARENTHESIS = The right parenthesis is missing from the OBJECT expression.
357
358
// OrderByClause - Grammar
359
ORDER_BY_CLAUSE_ORDER_BY_ITEM_ENDS_WITH_COMMA = The select expression cannot end with a comma.
360
ORDER_BY_CLAUSE_ORDER_BY_ITEM_IS_MISSING_COMMA = The ORDER BY clause has ''{0}'' and ''{1}'' that are not separated by a comma.
361
ORDER_BY_CLAUSE_ORDER_BY_ITEM_MISSING = The ordering item is missing from the ORDER BY clause.
362
363
// RangeVariableDeclaration - Grammar
364
RANGE_VARIABLE_DECLARATION_MISSING_ABSTRACT_SCHEMA_NAME = An abstract schema name must be specified.
365
RANGE_VARIABLE_DECLARATION_MISSING_IDENTIFICATION_VARIABLE = An identification variable must be provider for a range variable declaration.
366
367
// ResultVariable - Grammar
368
RESULT_VARIABLE_MISSING_SELECT_EXPRESSION = The select item is missing from the result variable declaration.
369
RESULT_VARIABLE_MISSING_RESULT_VARIABLE = The result variable is missing from the select item declaration.
370
371
// SelectStatement - Semantic
372
SELECT_STATEMENT_SELECT_CLAUSE_HAS_NON_AGGREGATE_FUNCTIONS = The select list can only consist of aggregate functions because there is no GROUP BY clause and the HAVING clause is used.
373
374
// SimpleSelectClause - Grammar
375
SIMPLE_SELECT_CLAUSE_NOT_SINGLE_EXPRESSION = Only one expression can be declared in a SELECT clause of a subquery.
376
377
// SizeExpression - Grammar
378
SIZE_EXPRESSION_INVALID_EXPRESSION = The encapsulated expression is not a valid expression.
379
SIZE_EXPRESSION_MISSING_EXPRESSION = A collection-valued path expression must be provided for a SIZE expression.
380
SIZE_EXPRESSION_MISSING_RIGHT_PARENTHESIS = The right parenthesis is missing from the SIZE expression.
381
SIZE_EXPRESSION_MISSING_LEFT_PARENTHESIS = The left parenthesis is missing from the SIZE expression.
382
383
// SqrtExpression - Grammar
384
SQRT_EXPRESSION_INVALID_EXPRESSION = The encapsulated expression is not a valid expression.
385
SQRT_EXPRESSION_MISSING_EXPRESSION = An expression must be provided for a SQRT expression.
386
SQRT_EXPRESSION_MISSING_LEFT_PARENTHESIS = The left parenthesis is missing from the SQRT expression.
387
SQRT_EXPRESSION_MISSING_RIGHT_PARENTHESIS = The right parenthesis is missing from the SQRT expression.
388
// SqrtExpression - Semantic
389
SQRT_EXPRESSION_WRONG_TYPE = The expression is not a numeric type.
390
391
// StateFieldPathExpression - Semantic
392
STATE_FIELD_PATH_EXPRESSION_ASSOCIATION_FIELD = The association field ''{0}'' cannot be used as a state field path.
393
STATE_FIELD_PATH_EXPRESSION_COLLECTION_TYPE = The state field path ''{0}'' cannot resolve to a collection type.
394
STATE_FIELD_PATH_EXPRESSION_INVALID_ENUM_CONSTANT = ''{0}'' cannot be resolved to an Enum constant.
395
STATE_FIELD_PATH_EXPRESSION_NO_MAPPING = No mapping is associated with the state field path ''{0}''.
396
STATE_FIELD_PATH_EXPRESSION_NOT_RESOLVABLE = The state field path ''{0}'' cannot be resolved to a valid type.
397
398
// SubExpression - Grammar
399
SUB_EXPRESSION_MISSING_EXPRESSION = The encapsulated expression is missing.
400
SUB_EXPRESSION_MISSING_RIGHT_PARENTHESIS = The right parenthesis is missing from the sub-expression.
401
402
// SubstractionExpression - Semantic
403
SUBSTRACTION_EXPRESSION_LEFT_EXPRESSION_WRONG_TYPE = The left side of the substraction is not a valid arithmetic expression.
404
SUBSTRACTION_EXPRESSION_RIGHT_EXPRESSION_WRONG_TYPE = The right side of the substraction is not a valid arithmetic expression.
405
406
// SubstringExpression - Grammar
407
SUBSTRING_EXPRESSION_INVALID_FIRST_EXPRESSION = The first argument is not a valid expression.
408
SUBSTRING_EXPRESSION_INVALID_SECOND_EXPRESSION = The second argument is not a valid expression.
409
SUBSTRING_EXPRESSION_INVALID_THIRD_EXPRESSION = The third argument is not a valid expression.
410
SUBSTRING_EXPRESSION_MISSING_FIRST_COMMA = The first comma is missing from the SUBSTRING expression.
411
SUBSTRING_EXPRESSION_MISSING_FIRST_EXPRESSION = The first argument is missing from the SUBSTRING expression.
412
SUBSTRING_EXPRESSION_MISSING_LEFT_PARENTHESIS = The left parenthesis is missing from the SUBSTRING expression.
413
SUBSTRING_EXPRESSION_MISSING_RIGHT_PARENTHESIS = The right parenthesis is missing from the SUBSTRING expression.
414
SUBSTRING_EXPRESSION_MISSING_SECOND_COMMA = The second comma is missing from the SUBSTRING expression.
415
SUBSTRING_EXPRESSION_MISSING_SECOND_EXPRESSION = The second argument is missing from the SUBSTRING expression.
416
SUBSTRING_EXPRESSION_MISSING_THIRD_EXPRESSION = The third argument is missing from the SUBSTRING expression.
417
// SubstringExpression - Semantic
418
SUBSTRING_EXPRESSION_FIRST_EXPRESSION_WRONG_TYPE = The first argument is not a String value.
419
SUBSTRING_EXPRESSION_SECOND_EXPRESSION_WRONG_TYPE = The first argument is not an integer value.
420
SUBSTRING_EXPRESSION_THIRD_EXPRESSION_WRONG_TYPE = The first argument is not an integer value.
421
422
// SumFunction - Grammar
423
SUM_FUNCTION_INVALID_EXPRESSION = The encapsulated expression is not a valid expression.
424
SUM_FUNCTION_MISSING_EXPRESSION = The encapsulated expression must be provided for a SUM expression.
425
SUM_FUNCTION_MISSING_LEFT_PARENTHESIS = The left parenthesis is missing from the SUM expression.
426
SUM_FUNCTION_MISSING_RIGHT_PARENTHESIS = The right parenthesis is missing from the SUM expression.
427
// SumFunction - Semantic
428
SUM_FUNCTION_WRONG_TYPE = The argument must be numeric.
429
430
// TrimExpression - Grammar
431
TRIM_EXPRESSION_INVALID_EXPRESSION = The encapsulated expression is not a valid expression.
432
TRIM_EXPRESSION_INVALID_TRIM_CHARACTER = The trim character should be a single-character string literal or a character-valued input parameter (i.e., char or Character).
433
TRIM_EXPRESSION_MISSING_EXPRESSION = An expression must be provided for a TRIM expression.
434
TRIM_EXPRESSION_MISSING_LEFT_PARENTHESIS = The left parenthesis is missing from the TRIM expression.
435
TRIM_EXPRESSION_MISSING_RIGHT_PARENTHESIS = The right parenthesis is missing from the TRIM expression.
436
TRIM_EXPRESSION_NOT_SINGLE_STRING_LITERAL = The trim character should be a single-character string literal.
437
438
// TypeExpression - Grammar
439
TYPE_EXPRESSION_INVALID_EXPRESSION = The encapsulated expression is not a valid expression.
440
TYPE_EXPRESSION_MISSING_EXPRESSION = An identification variable or a path expression must be provided for a TYPE expression.
441
TYPE_EXPRESSION_MISSING_LEFT_PARENTHESIS = The left parenthesis is missing from the TYPE expression.
442
TYPE_EXPRESSION_MISSING_RIGHT_PARENTHESIS = The right parenthesis is missing from the TYPE expression.
443
// TypeExpression - Semantic
444
445
// UpdateClause - Grammar
446
UPDATE_CLAUSE_MISSING_RANGE_VARIABLE_DECLARATION = The range variable declaration is missing from the UPDATE clause.
447
UPDATE_CLAUSE_MISSING_SET = The SET identifier is missing from the UPDATE clause.
448
UPDATE_CLAUSE_MISSING_UPDATE_ITEMS = At least one update item must be specified for an UPDATE clause.
449
UPDATE_CLAUSE_UPDATE_ITEM_ENDS_WITH_COMMA = The update item cannot end with a comma.
450
UPDATE_CLAUSE_UPDATE_ITEM_IS_MISSING_COMMA = The UPDATE clause has ''{0}'' and ''{1}'' that are not separated by a comma.
451
452
// UpdateItem - Grammar
453
UPDATE_ITEM_MISSING_EQUAL_SIGN = The equal sign must be specified.
454
UPDATE_ITEM_MISSING_NEW_VALUE = The new value must be specified.
455
UPDATE_ITEM_MISSING_STATE_FIELD_PATH_EXPRESSION = The state field path expression is missing.
456
// UpdateItem - Semantic
457
UPDATE_ITEM_NOT_ASSIGNABLE = Type mismatch: cannot convert from {0} to {1}.
458
UPDATE_ITEM_NOT_RESOLVABLE = The state field cannot be resolved.
459
460
// UpperExpression - Grammar
461
UPPER_EXPRESSION_INVALID_EXPRESSION = The encapsulated expression is not a valid expression.
462
UPPER_EXPRESSION_MISSING_EXPRESSION = An expression must be provided for a UPPER expression.
463
UPPER_EXPRESSION_MISSING_LEFT_PARENTHESIS = The left parenthesis is missing from the UPPER expression.
464
UPPER_EXPRESSION_MISSING_RIGHT_PARENTHESIS = The right parenthesis is missing from the UPPER expression.
465
// UpperExpression - Semantic
466
UPPER_EXPRESSION_WRONG_TYPE = The expression is not a String.
467
468
// ValueExpression - Grammar
469
VALUE_EXPRESSION_INVALID_EXPRESSION = The encapsulated expression is not a valid expression.
470
VALUE_EXPRESSION_MISSING_EXPRESSION = An identification variable must be provided for a VALUE expression.
471
VALUE_EXPRESSION_MISSING_LEFT_PARENTHESIS = The left parenthesis is missing from the VALUE expression.
472
VALUE_EXPRESSION_MISSING_RIGHT_PARENTHESIS = The right parenthesis is missing from the VALUE expression.
473
474
// WhenClause - Grammar
475
WHEN_CLAUSE_MISSING_THEN_EXPRESSION = A conditional expression must be provider for a WHEN clause.
476
WHEN_CLAUSE_MISSING_THEN_IDENTIFIER = The identifier THEN is missing from the WHEN clause.
477
WHEN_CLAUSE_MISSING_WHEN_EXPRESSION = A WHEN expression must be provided for a WHEN clause.
478
479
// WhereClause - Grammar
480
WHERE_CLAUSE_INVALID_CONDITIONAL_EXPRESSION = The expression is not a valid conditional expression.
481
WHERE_CLAUSE_MISSING_CONDITIONAL_EXPRESSION = The conditional expression is missing from the WHERE clause.
(-)src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJavaNamedQuery.java (-2 / +30 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2007, 2010 Oracle. All rights reserved.
2
 * Copyright (c) 2007, 2011 Oracle. All rights reserved.
3
 * This program and the accompanying materials are made available under the
3
 * This program and the accompanying materials are made available under the
4
 * terms of the Eclipse Public License v1.0, which accompanies this distribution
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.
5
 * and is available at http://www.eclipse.org/legal/epl-v10.html.
Lines 9-18 Link Here
9
 ******************************************************************************/
9
 ******************************************************************************/
10
package org.eclipse.jpt.jpa.core.internal.jpa1.context.java;
10
package org.eclipse.jpt.jpa.core.internal.jpa1.context.java;
11
11
12
import java.util.List;
13
import org.eclipse.jdt.core.dom.CompilationUnit;
14
import org.eclipse.jpt.common.core.utility.TextRange;
12
import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
15
import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
13
import org.eclipse.jpt.jpa.core.context.java.JavaNamedQuery;
16
import org.eclipse.jpt.jpa.core.context.java.JavaNamedQuery;
14
import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaQuery;
17
import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaQuery;
18
import org.eclipse.jpt.jpa.core.internal.jpql.JpaJpqlQueryHelper;
15
import org.eclipse.jpt.jpa.core.resource.java.NamedQueryAnnotation;
19
import org.eclipse.jpt.jpa.core.resource.java.NamedQueryAnnotation;
20
import org.eclipse.persistence.jpa.jpql.JPQLQueryProblem;
21
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
22
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
16
23
17
/**
24
/**
18
 * Java named query
25
 * Java named query
Lines 24-27 Link Here
24
	public GenericJavaNamedQuery(JavaJpaContextNode parent, NamedQueryAnnotation queryAnnotation) {
31
	public GenericJavaNamedQuery(JavaJpaContextNode parent, NamedQueryAnnotation queryAnnotation) {
25
		super(parent, queryAnnotation);
32
		super(parent, queryAnnotation);
26
	}
33
	}
27
}
34
35
36
	// ********** validation **********
37
38
	/**
39
	 * {@inheritDoc}
40
	 */
41
	@Override
42
	public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
43
		super.validate(messages, reporter, astRoot);
44
45
		JpaJpqlQueryHelper helper = new JpaJpqlQueryHelper(this);
46
		String parsedJpqlQuery = helper.getParsedJPQLQuery();
47
		String jpqlQuery = getQuery();
48
49
		for (JPQLQueryProblem problem : helper.validate()) {
50
			TextRange textRange = this.getQueryAnnotation().getQueryTextRange(astRoot);
51
			IMessage message = helper.buildProblem(this, problem, textRange, jpqlQuery, parsedJpqlQuery);
52
			messages.add(message);
53
		}
54
	}
55
}
(-)src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJavaQueryContainer.java (-2 / +5 lines)
Lines 308-317 Link Here
308
	@Override
308
	@Override
309
	public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
309
	public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
310
		super.validate(messages, reporter, astRoot);
310
		super.validate(messages, reporter, astRoot);
311
		this.validateQueries(messages, astRoot);
311
		this.validateQueries(messages, reporter, astRoot);
312
	}
312
	}
313
313
314
	protected void validateQueries(List<IMessage> messages, CompilationUnit astRoot) {
314
	protected void validateQueries(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
315
		for (Iterator<JavaQuery> localQueries = this.queries(); localQueries.hasNext(); ) {
315
		for (Iterator<JavaQuery> localQueries = this.queries(); localQueries.hasNext(); ) {
316
			JavaQuery localQuery = localQueries.next();
316
			JavaQuery localQuery = localQueries.next();
317
			String name = localQuery.getName();
317
			String name = localQuery.getName();
Lines 354-359 Link Here
354
						)
354
						)
355
				);
355
				);
356
			}
356
			}
357
			else {
358
				localQuery.validate(messages, reporter, astRoot);
359
			}
357
		}
360
		}
358
	}
361
	}
359
362
(-)src/org/eclipse/jpt/jpa/core/internal/jpa2/context/java/GenericJavaNamedQuery2_0.java (-2 / +29 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
* Copyright (c) 2009, 2010 Oracle. All rights reserved.
2
* Copyright (c) 2009, 2011 Oracle. All rights reserved.
3
* This program and the accompanying materials are made available under the
3
* This program and the accompanying materials are made available under the
4
* terms of the Eclipse Public License v1.0, which accompanies this distribution
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.
5
* and is available at http://www.eclipse.org/legal/epl-v10.html.
Lines 9-19 Link Here
9
*******************************************************************************/
9
*******************************************************************************/
10
package org.eclipse.jpt.jpa.core.internal.jpa2.context.java;
10
package org.eclipse.jpt.jpa.core.internal.jpa2.context.java;
11
11
12
import java.util.List;
13
import org.eclipse.jdt.core.dom.CompilationUnit;
14
import org.eclipse.jpt.common.core.utility.TextRange;
12
import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
15
import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
13
import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaQuery;
16
import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaQuery;
17
import org.eclipse.jpt.jpa.core.internal.jpql.JpaJpqlQueryHelper;
14
import org.eclipse.jpt.jpa.core.jpa2.context.LockModeType2_0;
18
import org.eclipse.jpt.jpa.core.jpa2.context.LockModeType2_0;
15
import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaNamedQuery2_0;
19
import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaNamedQuery2_0;
16
import org.eclipse.jpt.jpa.core.jpa2.resource.java.NamedQuery2_0Annotation;
20
import org.eclipse.jpt.jpa.core.jpa2.resource.java.NamedQuery2_0Annotation;
21
import org.eclipse.persistence.jpa.jpql.JPQLQueryProblem;
22
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
23
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
17
24
18
/**
25
/**
19
 * JPA 2.0
26
 * JPA 2.0
Lines 87-90 Link Here
87
		return LockModeType2_0.NONE;
94
		return LockModeType2_0.NONE;
88
	}
95
	}
89
96
90
}
97
98
	// ********** validation **********
99
100
	/**
101
	 * {@inheritDoc}
102
	 */
103
	@Override
104
	public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
105
		super.validate(messages, reporter, astRoot);
106
107
		JpaJpqlQueryHelper helper = new JpaJpqlQueryHelper(this);
108
		String parsedJpqlQuery = helper.getParsedJPQLQuery();
109
		String jpqlQuery = getQuery();
110
111
		for (JPQLQueryProblem problem : helper.validate()) {
112
			TextRange textRange = this.getQueryAnnotation().getQueryTextRange(astRoot);
113
			IMessage message = helper.buildProblem(this, problem, textRange, jpqlQuery, parsedJpqlQuery);
114
			messages.add(message);
115
		}
116
	}
117
}
(-)src/org/eclipse/jpt/jpa/core/internal/jpql/JpaConstructor.java (+102 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2011 Oracle. All rights reserved.
3
 * This program and the accompanying materials are made available under the 
4
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
5
 * which accompanies this distribution. 
6
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
7
 * and the Eclipse Distribution License is available at 
8
 * http://www.eclipse.org/org/documents/edl-v10.php.
9
 *
10
 * Contributors:
11
 *     Oracle - initial API and implementation
12
 *
13
 ******************************************************************************/
14
package org.eclipse.jpt.jpa.core.internal.jpql;
15
16
import org.eclipse.jdt.core.dom.IMethodBinding;
17
import org.eclipse.jdt.core.dom.ITypeBinding;
18
import org.eclipse.jdt.core.dom.MethodDeclaration;
19
import org.eclipse.persistence.jpa.jpql.spi.IConstructor;
20
import org.eclipse.persistence.jpa.jpql.spi.IType;
21
import org.eclipse.persistence.jpa.jpql.spi.ITypeDeclaration;
22
23
/**
24
 * The concrete implementation of {@link IConstructor} that is wrapping the design-time
25
 * representation of a Java constructor.
26
 *
27
 * @version 3.0
28
 * @since 3.0
29
 * @author Pascal Filion
30
 */
31
final class JpaConstructor implements IConstructor {
32
33
	/**
34
	 * The design-time representation of a Java constructor.
35
	 */
36
	private final MethodDeclaration method;
37
38
	/**
39
	 * The cached {@link ITypeDeclaration ITypeDeclarations} representing each of the constructor's
40
	 * parameter types.
41
	 */
42
	private ITypeDeclaration[] typeDeclarations;
43
44
	/**
45
	 * The repository of Java types.
46
	 */
47
	private final JpaTypeRepository typeRepository;
48
49
	/**
50
	 * Creates a new <code>JpaConstructor</code>.
51
	 *
52
	 * @param typeRepository The repository of Java types
53
	 * @param method The design-time representation of a Java constructor
54
	 */
55
	JpaConstructor(JpaTypeRepository typeRepository, MethodDeclaration method) {
56
		super();
57
		this.method         = method;
58
		this.typeRepository = typeRepository;
59
	}
60
61
	private ITypeDeclaration buildTypeDeclaration(ITypeBinding parameterType) {
62
63
		boolean array = parameterType.isArray();
64
		String typeName = array ? parameterType.getComponentType().getBinaryName() : parameterType.getBinaryName();
65
66
		// Retrieve the fully qualified name of the type
67
		ITypeBinding[] typeArguments = parameterType.getTypeArguments();
68
		ITypeDeclaration[] genericTypes = new ITypeDeclaration[typeArguments.length];
69
		int index = 0;
70
71
		for (ITypeBinding typeArgument : typeArguments) {
72
			String genericTypeName = typeArgument.getErasure().getBinaryName();
73
			IType genericType = typeRepository.getType(genericTypeName);
74
			genericTypes[index++] = genericType.getTypeDeclaration();
75
		}
76
77
		return new JpaTypeDeclaration(typeRepository.getType(typeName), genericTypes, array);
78
	}
79
80
	private ITypeDeclaration[] buildTypeDeclarations() {
81
82
		IMethodBinding binding = method.resolveBinding();
83
		ITypeBinding[] parameterTypes = binding.getParameterTypes();
84
		ITypeDeclaration[] declarations = new ITypeDeclaration[parameterTypes.length];
85
86
		for (int index = declarations.length; --index >= 0; ) {
87
			declarations[index] = buildTypeDeclaration(parameterTypes[index]);
88
		}
89
90
		return declarations;
91
	}
92
93
	/**
94
	 * {@inheritDoc}
95
	 */
96
	public ITypeDeclaration[] getParameterTypes() {
97
		if (typeDeclarations == null) {
98
			typeDeclarations = buildTypeDeclarations();
99
		}
100
		return typeDeclarations;
101
	}
102
}
(-)src/org/eclipse/jpt/jpa/core/internal/jpql/JpaEmbeddable.java (+55 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2011 Oracle. All rights reserved.
3
 * This program and the accompanying materials are made available under the 
4
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
5
 * which accompanies this distribution. 
6
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
7
 * and the Eclipse Distribution License is available at 
8
 * http://www.eclipse.org/org/documents/edl-v10.php.
9
 *
10
 * Contributors:
11
 *     Oracle - initial API and implementation
12
 *
13
 ******************************************************************************/
14
package org.eclipse.jpt.jpa.core.internal.jpql;
15
16
import org.eclipse.jpt.jpa.core.context.Embeddable;
17
import org.eclipse.persistence.jpa.jpql.spi.IEmbeddable;
18
import org.eclipse.persistence.jpa.jpql.spi.IManagedTypeVisitor;
19
20
/**
21
 * The concrete implementation of {@link IEmbeddable} that is wrapping the design-time
22
 * representation of a JPA embeddable.
23
 *
24
 * @version 3.0
25
 * @since 3.0
26
 * @author Pascal Filion
27
 */
28
final class JpaEmbeddable extends JpaManagedType
29
                          implements IEmbeddable {
30
31
	/**
32
	 * Creates a new <code>JpaEmbeddable</code>.
33
	 *
34
	 * @param provider The provider of JPA managed types
35
	 * @param embeddable The design-time model object wrapped by this class
36
	 */
37
	JpaEmbeddable(JpaManagedTypeProvider provider, Embeddable embeddable) {
38
		super(provider, embeddable);
39
	}
40
41
	/**
42
	 * {@inheritDoc}
43
	 */
44
	public void accept(IManagedTypeVisitor visitor) {
45
		visitor.visit(this);
46
	}
47
48
	/**
49
	 * {@inheritDoc}
50
	 */
51
	@Override
52
	Embeddable getManagedType() {
53
		return (Embeddable) super.getManagedType();
54
	}
55
}
(-)src/org/eclipse/jpt/jpa/core/internal/jpql/JpaEntity.java (+96 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2011 Oracle. All rights reserved.
3
 * This program and the accompanying materials are made available under the 
4
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
5
 * which accompanies this distribution. 
6
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
7
 * and the Eclipse Distribution License is available at 
8
 * http://www.eclipse.org/org/documents/edl-v10.php.
9
 *
10
 * Contributors:
11
 *     Oracle - initial API and implementation
12
 *
13
 ******************************************************************************/
14
package org.eclipse.jpt.jpa.core.internal.jpql;
15
16
import java.util.HashMap;
17
import java.util.ListIterator;
18
import java.util.Map;
19
import org.eclipse.jpt.jpa.core.context.Entity;
20
import org.eclipse.jpt.jpa.core.context.NamedQuery;
21
import org.eclipse.persistence.jpa.jpql.spi.IEntity;
22
import org.eclipse.persistence.jpa.jpql.spi.IManagedTypeVisitor;
23
import org.eclipse.persistence.jpa.jpql.spi.IQuery;
24
25
/**
26
 * The concrete implementation of {@link IEntity} that is wrapping the design-time representation
27
 * of a JPA entity.
28
 *
29
 * @version 3.0
30
 * @since 3.0
31
 * @author Pascal Filion
32
 */
33
abstract class JpaEntity extends JpaManagedType
34
                         implements IEntity {
35
36
	/**
37
	 * The cached used to quickly retrieve any queries that have been cached.
38
	 */
39
	private Map<String, IQuery> queries;
40
41
	/**
42
	 * Creates a new <code>JpaEntity</code>.
43
	 *
44
	 * @param provider The provider of JPA managed types
45
	 * @param entity The design-time model object wrapped by this class
46
	 */
47
	JpaEntity(JpaManagedTypeProvider provider, Entity entity) {
48
		super(provider, entity);
49
	}
50
51
	/**
52
	 * {@inheritDoc}
53
	 */
54
	public void accept(IManagedTypeVisitor visitor) {
55
		visitor.visit(this);
56
	}
57
58
	final IQuery buildQuery(JpaManagedTypeProvider provider, NamedQuery namedQuery) {
59
		return new JpaQuery(provider, namedQuery);
60
	}
61
62
	/**
63
	 * {@inheritDoc}
64
	 */
65
	@Override
66
	Entity getManagedType() {
67
		return (Entity) super.getManagedType();
68
	}
69
70
	/**
71
	 * {@inheritDoc}
72
	 */
73
	public IQuery getNamedQuery(String queryName) {
74
		initializeQueries();
75
		return queries.get(queryName);
76
	}
77
78
	void initializeQueries(Map<String, IQuery> queries) {
79
		JpaManagedTypeProvider provider = getProvider();
80
		for (ListIterator<NamedQuery> iter = namedQueries(); iter.hasNext(); ) {
81
			NamedQuery namedQuery = iter.next();
82
			queries.put(namedQuery.getName(), buildQuery(provider, namedQuery));
83
		}
84
	}
85
86
	private void initializeQueries() {
87
		if (queries == null) {
88
			queries = new HashMap<String, IQuery>();
89
			initializeQueries(queries);
90
		}
91
	}
92
93
	private ListIterator<NamedQuery> namedQueries() {
94
		return getManagedType().getQueryContainer().namedQueries();
95
	}
96
}
(-)src/org/eclipse/jpt/jpa/core/internal/jpql/JpaJpqlQueryHelper.java (+171 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2011 Oracle. All rights reserved.
3
 * This program and the accompanying materials are made available under the 
4
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
5
 * which accompanies this distribution. 
6
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
7
 * and the Eclipse Distribution License is available at 
8
 * http://www.eclipse.org/org/documents/edl-v10.php.
9
 *
10
 * Contributors:
11
 *     Oracle - initial API and implementation
12
 *
13
 ******************************************************************************/
14
package org.eclipse.jpt.jpa.core.internal.jpql;
15
16
import org.eclipse.jpt.common.core.internal.utility.SimpleTextRange;
17
import org.eclipse.jpt.common.core.utility.TextRange;
18
import org.eclipse.jpt.jpa.core.context.NamedQuery;
19
import org.eclipse.jpt.jpa.core.internal.validation.DefaultJpaValidationMessages;
20
import org.eclipse.persistence.jpa.jpql.ExpressionTools;
21
import org.eclipse.persistence.jpa.jpql.JPQLQueryHelper;
22
import org.eclipse.persistence.jpa.jpql.JPQLQueryProblem;
23
import org.eclipse.persistence.jpa.jpql.spi.IQuery;
24
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
25
26
/**
27
 * This helper can perform the following operations over a JPQL query:
28
 * <ul>
29
 * <li>Calculates the result type of a query: {@link #getResultType()};</li>
30
 * <li>Calculates the type of an input parameter: {@link #getParameterType(String)}.</li>
31
 * <li>Calculates the possible choices to complete the query from a given
32
 *     position (used for content assist): {@link #buildContentAssistItems(int)}.</li>
33
 * <li>Validates the query by introspecting its grammar and semantic:
34
 *     <ul>
35
 *     <li>{@link #validate()},</li>
36
 *     <li>{@link #validateGrammar()},</li>
37
 *     <li>{@link #validateSemantic()}.</li>
38
 *     </ul></li>
39
 *
40
 * @version 3.0
41
 * @since 3.0
42
 * @author Pascal Filion
43
 */
44
@SuppressWarnings("nls")
45
public final class JpaJpqlQueryHelper extends JPQLQueryHelper<NamedQuery> {
46
47
	/**
48
	 * The actual JPQL query, which can differ from the one owned by the model object, which happens
49
	 * when the model is out of sync because it has not been updated yet.
50
	 */
51
	private final String actualQuery;
52
53
	/**
54
	 * The external form of the JPQL query that was already created before this helper, which happens
55
	 * during the execution of the unit-tests.
56
	 */
57
	private IQuery localQuery;
58
59
	/**
60
	 * Creates a new <code>JpaJpqlQueryHelper</code>. This constructor is used only by the unit-tests.
61
	 *
62
	 * @param query The external form that is already wrapping the {@link MWNamedQuery}
63
	 * @exception NullPointerException If the query is <code>null</code>
64
	 */
65
	public JpaJpqlQueryHelper(IQuery query) {
66
		this(((JpaQuery) query).getQuery());
67
		this.localQuery = query;
68
	}
69
70
	/**
71
	 * Creates a new <code>JpaJpqlQueryHelper</code>.
72
	 *
73
	 * @param query The model object where the JPQL query is stored
74
	 * @exception NullPointerException If the given {@link NamedQuery} is <code>null</code>
75
	 */
76
	public JpaJpqlQueryHelper(NamedQuery query) {
77
		this(query, query.getQuery());
78
	}
79
80
	/**
81
	 * Creates a new <code>JpaQueryHelper</code>.
82
	 *
83
	 * @param query The model object where the JPQL query is stored
84
	 * @param actualQuery The actual JPQL query, which can differ from the one owned by the model
85
	 * object, which happens when the model is out of sync because it has not been updated yet
86
	 * @exception NullPointerException If the given {@link NamedQuery} is <code>null</code>
87
	 */
88
	public JpaJpqlQueryHelper(NamedQuery query, String actualQuery) {
89
		super(query);
90
		this.actualQuery = actualQuery;
91
	}
92
93
	/**
94
	 * Creates a new {@link IMessage} for the given {@link JPQLQueryProblem}.
95
	 *
96
	 * @param targetObject The object for which a new {@link IMessage} is creating describing the
97
	 * problem
98
	 * @param problem The {@link JPQLQueryProblem problem} that was found in the JPQL query, which is
99
	 * either a grammatical or semantic problem
100
	 * @param textRange The range of the JPQL query in the Java source file
101
	 * @param jpqlQuery The actual JPQL query that was parsed and validated
102
	 * @param parsedJpqlQuery The string representation of the parsed tree representation of the JPQL
103
	 * query, which may differ from the actual JPQL query since it does not keep more than one
104
	 * whitespace
105
	 * @return A new {@link IMessage} that has the required information to display the problem
106
	 * underline and the error message in the Problems view
107
	 */
108
	public IMessage buildProblem(Object targetObject,
109
	                             JPQLQueryProblem problem,
110
	                             TextRange textRange,
111
	                             String parsedJpqlQuery,
112
	                             String parsedQuery) {
113
114
		int length = parsedQuery.length();
115
		int startPosition = problem.getStartPosition();
116
		int endPosition = problem.getEndPosition();
117
118
		// If the start and end positions are the same, then expand the text range
119
		if (startPosition == endPosition) {
120
			startPosition = Math.max(startPosition - 2, 0);
121
			endPosition   = Math.min(endPosition + 1, length);
122
		}
123
124
		// Reposition the cursor so it's correctly positioned in the JPQL query, which is the
125
		// since it may contains more than one whitespace for a single whitespace
126
		int newStartPosition = ExpressionTools.repositionCursor(parsedJpqlQuery, parsedQuery, startPosition);
127
128
		if (newStartPosition != startPosition) {
129
			endPosition  += (newStartPosition - startPosition);
130
			startPosition = newStartPosition;
131
		}
132
133
		// Create the text range of the problem
134
		textRange = new SimpleTextRange(
135
			textRange.getOffset() + startPosition + 1,
136
			endPosition - startPosition,
137
			textRange.getLineNumber()
138
		);
139
140
		// Now create the message
141
		IMessage message = DefaultJpaValidationMessages.buildMessage(
142
			IMessage.HIGH_SEVERITY,
143
			problem.getMessageKey(),
144
			problem.getMessageArguments(),
145
			targetObject,
146
			textRange
147
		);
148
		message.setBundleName("jpa_jpql_validation");
149
		return message;
150
	}
151
152
	private JpaManagedTypeProvider buildProvider(NamedQuery query) {
153
		try {
154
			return new JpaPersistenceUnit(query.getJpaProject(), query.getPersistenceUnit());
155
		}
156
		catch (Exception e) {
157
			return new JpaMappingFile(query.getJpaProject(), query.getMappingFileRoot().getParent());
158
		}
159
	}
160
161
	/**
162
	 * {@inheritDoc}
163
	 */
164
	@Override
165
	protected IQuery buildQuery(NamedQuery query) {
166
		if (localQuery == null) {
167
			localQuery = new JpaQuery(buildProvider(query), query, actualQuery);
168
		}
169
		return localQuery;
170
	}
171
}
(-)src/org/eclipse/jpt/jpa/core/internal/jpql/JpaManagedType.java (+127 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2011 Oracle. All rights reserved.
3
 * This program and the accompanying materials are made available under the 
4
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
5
 * which accompanies this distribution. 
6
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
7
 * and the Eclipse Distribution License is available at 
8
 * http://www.eclipse.org/org/documents/edl-v10.php.
9
 *
10
 * Contributors:
11
 *     Oracle - initial API and implementation
12
 *
13
 ******************************************************************************/
14
package org.eclipse.jpt.jpa.core.internal.jpql;
15
16
import java.util.HashMap;
17
import java.util.Iterator;
18
import java.util.Map;
19
import org.eclipse.jpt.jpa.core.context.AttributeMapping;
20
import org.eclipse.jpt.jpa.core.context.TypeMapping;
21
import org.eclipse.persistence.jpa.jpql.spi.IManagedType;
22
import org.eclipse.persistence.jpa.jpql.spi.IMapping;
23
24
/**
25
 * The abstract definition of {@link IManagedType} defined for wrapping the design-time mapped class
26
 * object.
27
 *
28
 * @version 3.0
29
 * @since 3.0
30
 * @author Pascal Filion
31
 */
32
abstract class JpaManagedType implements IManagedType {
33
34
	/**
35
	 * The design-time model object wrapped by this class.
36
	 */
37
	private final TypeMapping managedType;
38
39
	/**
40
	 * The cached collection of {@link IMapping mappings} that prevent rebuilding them every time one
41
	 * is requested.
42
	 */
43
	private Map<String, IMapping> mappings;
44
45
	/**
46
	 * The provider of JPA managed types.
47
	 */
48
	private final JpaManagedTypeProvider provider;
49
50
	/**
51
	 * The cached wrapper over {@link TODO}.
52
	 */
53
	private JpaType type;
54
55
	/**
56
	 * Creates a new <code>JDeveloperManagedType</code>.
57
	 *
58
	 * @param managedType The provider of JPA managed types
59
	 * @param mappedClass The design-time model object wrapped by this class
60
	 */
61
	JpaManagedType(JpaManagedTypeProvider provider, TypeMapping managedType) {
62
		super();
63
		this.provider    = provider;
64
		this.managedType = managedType;
65
	}
66
67
	private IMapping buildMapping(AttributeMapping mapping) {
68
		return new JpaMapping(this, mapping);
69
	}
70
71
	private Map<String, IMapping> buildMappings() {
72
		Map<String, IMapping> mappings = new HashMap<String, IMapping>();
73
		for (Iterator<AttributeMapping> iter = managedType.allAttributeMappings(); iter.hasNext(); ) {
74
			AttributeMapping mapping = iter.next();
75
			mappings.put(mapping.getName(), buildMapping(mapping));
76
		}
77
		return mappings;
78
	}
79
80
	/**
81
	 * Returns the encapsulated model object.
82
	 *
83
	 * @return The managed type wrapped by this external form
84
	 */
85
	TypeMapping getManagedType() {
86
		return managedType;
87
	}
88
89
	/**
90
	 * {@inheritDoc}
91
	 */
92
	public final IMapping getMappingNamed(String name) {
93
		initializeMappings();
94
		return mappings.get(name);
95
	}
96
97
	/**
98
	 * {@inheritDoc}
99
	 */
100
	public final JpaManagedTypeProvider getProvider() {
101
		return provider;
102
	}
103
104
	/**
105
	 * {@inheritDoc}
106
	 */
107
	public final JpaType getType() {
108
		if (type == null) {
109
			type = provider.getTypeRepository().getType(managedType.getPersistentType().getName());
110
		}
111
		return type;
112
	}
113
114
	private void initializeMappings() {
115
		if (mappings == null) {
116
			mappings = buildMappings();
117
		}
118
	}
119
120
	/**
121
	 * {@inheritDoc}
122
	 */
123
	public final Iterator<IMapping> mappings() {
124
		initializeMappings();
125
		return mappings.values().iterator();
126
	}
127
}
(-)src/org/eclipse/jpt/jpa/core/internal/jpql/JpaManagedTypeProvider.java (+222 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2011 Oracle. All rights reserved.
3
 * This program and the accompanying materials are made available under the 
4
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
5
 * which accompanies this distribution. 
6
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
7
 * and the Eclipse Distribution License is available at 
8
 * http://www.eclipse.org/org/documents/edl-v10.php.
9
 *
10
 * Contributors:
11
 *     Oracle - initial API and implementation
12
 *
13
 ******************************************************************************/
14
package org.eclipse.jpt.jpa.core.internal.jpql;
15
16
import java.util.HashMap;
17
import java.util.Iterator;
18
import java.util.Map;
19
import org.eclipse.jpt.jpa.core.JpaFacet;
20
import org.eclipse.jpt.jpa.core.JpaPlatform;
21
import org.eclipse.jpt.jpa.core.JpaProject;
22
import org.eclipse.jpt.jpa.core.context.Embeddable;
23
import org.eclipse.jpt.jpa.core.context.Entity;
24
import org.eclipse.jpt.jpa.core.context.MappedSuperclass;
25
import org.eclipse.jpt.jpa.core.context.PersistentType;
26
import org.eclipse.jpt.jpa.core.context.TypeMapping;
27
import org.eclipse.jpt.jpa.core.context.persistence.PersistentTypeContainer;
28
import org.eclipse.persistence.jpa.jpql.spi.IJPAVersion;
29
import org.eclipse.persistence.jpa.jpql.spi.IManagedType;
30
import org.eclipse.persistence.jpa.jpql.spi.IManagedTypeProvider;
31
import org.eclipse.persistence.jpa.jpql.spi.IPlatform;
32
import org.eclipse.persistence.jpa.jpql.spi.IType;
33
34
/**
35
 * The abstract implementation of {@link IManagedTypeProvider} that is wrapping the design-time
36
 * representation of a provider of managed types.
37
 *
38
 * @version 3.0
39
 * @since 3.0
40
 * @author Pascal Filion
41
 */
42
abstract class JpaManagedTypeProvider implements IManagedTypeProvider {
43
44
	/**
45
	 * The project that gives access to the application's metadata.
46
	 */
47
	private final JpaProject jpaProject;
48
49
	/**
50
	 * The cached {@link IManagedType managed types}.
51
	 */
52
	private Map<String, IManagedType> managedTypes;
53
54
	/**
55
	 * The design-time provider of managed types.
56
	 */
57
	private final PersistentTypeContainer persistentTypeContainer;
58
59
	/**
60
	 * The external form of a type repository.
61
	 */
62
	private JpaTypeRepository typeRepository;
63
64
	/**
65
	 * The version of the Java Persistence this entity for which it was defined.
66
	 */
67
	private IJPAVersion version;
68
69
	/**
70
	 * Creates a new <code>JpaManagedTypeProvider</code>.
71
	 * 
72
	 * @param jpaProject The project that gives access to the application's metadata
73
	 * @param persistentTypeContainer The design-time provider of managed types
74
	 */
75
	JpaManagedTypeProvider(JpaProject jpaProject, PersistentTypeContainer persistentTypeContainer) {
76
77
		super();
78
		this.jpaProject = jpaProject;
79
		this.persistentTypeContainer = persistentTypeContainer;
80
	}
81
82
	abstract JpaEntity buildEntity(TypeMapping mappedClass);
83
84
	private IManagedType buildManagedType(PersistentType persistentType) {
85
86
		TypeMapping mappedClass = persistentType.getMapping();
87
88
		if (mappedClass instanceof Entity) {
89
			return buildEntity(mappedClass);
90
		}
91
92
		if (mappedClass instanceof MappedSuperclass) {
93
			return new JpaMappedSuperclass(this, (MappedSuperclass) mappedClass);
94
		}
95
96
		if (mappedClass instanceof Embeddable) {
97
			return new JpaEmbeddable(this, (Embeddable) mappedClass);
98
		}
99
100
		return new JpaNullManagedType(this, mappedClass);
101
	}
102
103
	private Map<String, IManagedType> buildManagedTypes() {
104
		Map<String, IManagedType> managedTypes = new HashMap<String, IManagedType>();
105
		for (Iterator<? extends PersistentType> iter = persistenceTypes(); iter.hasNext(); ) {
106
			PersistentType persistentType = iter.next();
107
			managedTypes.put(persistentType.getMapping().getName(), buildManagedType(persistentType));
108
		}
109
		return managedTypes;
110
	}
111
112
	private IJPAVersion convert(JpaPlatform.Version version) {
113
114
		String jpaVersion = version.getJpaVersion();
115
116
		if (JpaFacet.VERSION_1_0.getVersionString().equals(jpaVersion)) {
117
			return IJPAVersion.VERSION_1_0;
118
		}
119
120
		return IJPAVersion.VERSION_2_0;
121
	}
122
123
	/**
124
	 * {@inheritDoc}
125
	 */
126
	public Iterator<String> entityNames() {
127
		initializeManagedTypes();
128
		return managedTypes.keySet().iterator();
129
	}
130
131
	/**
132
	 * {@inheritDoc}
133
	 */
134
	public IManagedType getManagedType(IType type) {
135
136
		initializeManagedTypes();
137
138
		for (IManagedType managedType : managedTypes.values()) {
139
			if (managedType.getType() == type) {
140
				return managedType;
141
			}
142
		}
143
144
		return null;
145
	}
146
147
	/**
148
	 * {@inheritDoc}
149
	 */
150
	public IManagedType getManagedType(String abstractSchemaName) {
151
		initializeManagedTypes();
152
		return managedTypes.get(abstractSchemaName);
153
	}
154
155
	/**
156
	 * Returns the container of managed types.
157
	 *
158
	 * @return The container of managed types
159
	 */
160
	PersistentTypeContainer getPersistentTypeContainer() {
161
		return persistentTypeContainer;
162
	}
163
164
	/**
165
	 * {@inheritDoc}
166
	 */
167
	public IPlatform getPlatform() {
168
		return IPlatform.JAVA;
169
		// TODO
170
//		return (jpaProject instanceof EclipseLinkJpaProject) ? IPlatform.ECLIPSE_LINK : IPlatform.JAVA;
171
	}
172
173
	/**
174
	 * Returns the encapsulated {@link PersistentType}, which is the actual object.
175
	 *
176
	 * @return The design-time representation of a managed type provider
177
	 */
178
	PersistentTypeContainer getProvider() {
179
		return persistentTypeContainer;
180
	}
181
182
	/**
183
	 * {@inheritDoc}
184
	 */
185
	public JpaTypeRepository getTypeRepository() {
186
		if (typeRepository == null) {
187
			typeRepository = new JpaTypeRepository(jpaProject.getJavaProject());
188
		}
189
		return typeRepository;
190
	}
191
192
	/**
193
	 * {@inheritDoc}
194
	 */
195
	public IJPAVersion getVersion() {
196
		if (version == null) {
197
			version = convert(jpaProject.getJpaPlatform().getJpaVersion());
198
		}
199
		return version;
200
	}
201
202
	private void initializeManagedTypes() {
203
		if (managedTypes == null) {
204
			managedTypes = buildManagedTypes();
205
		}
206
	}
207
208
	/**
209
	 * {@inheritDoc}
210
	 */
211
	public Iterator<IManagedType> managedTypes() {
212
		initializeManagedTypes();
213
		return managedTypes.values().iterator();
214
	}
215
216
	/**
217
	 * Retrieves the managed types from the design-time provider.
218
	 *
219
	 * @return The managed types that are defined only in the provider
220
	 */
221
	abstract Iterator<? extends PersistentType> persistenceTypes();
222
}
(-)src/org/eclipse/jpt/jpa/core/internal/jpql/JpaMappedSuperclass.java (+55 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2011 Oracle. All rights reserved.
3
 * This program and the accompanying materials are made available under the 
4
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
5
 * which accompanies this distribution. 
6
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
7
 * and the Eclipse Distribution License is available at 
8
 * http://www.eclipse.org/org/documents/edl-v10.php.
9
 *
10
 * Contributors:
11
 *     Oracle - initial API and implementation
12
 *
13
 ******************************************************************************/
14
package org.eclipse.jpt.jpa.core.internal.jpql;
15
16
import org.eclipse.jpt.jpa.core.context.MappedSuperclass;
17
import org.eclipse.persistence.jpa.jpql.spi.IManagedTypeVisitor;
18
import org.eclipse.persistence.jpa.jpql.spi.IMappedSuperclass;
19
20
/**
21
 * The concrete implementation of {@link IMappedSuperclass} that is wrapping the design-time
22
 * representation of a JPA mapped superclass.
23
 *
24
 * @version 3.0
25
 * @since 3.0
26
 * @author Pascal Filion
27
 */
28
final class JpaMappedSuperclass extends JpaManagedType
29
                                implements IMappedSuperclass {
30
31
	/**
32
	 * Creates a new <code>JpaMappedSuperclass</code>.
33
	 *
34
	 * @param provider The provider of JPA managed types
35
	 * @param mappedSuperclass The design-time model object wrapped by this class
36
	 */
37
	JpaMappedSuperclass(JpaManagedTypeProvider provider, MappedSuperclass mappedSuperclass) {
38
		super(provider, mappedSuperclass);
39
	}
40
41
	/**
42
	 * {@inheritDoc}
43
	 */
44
	public void accept(IManagedTypeVisitor visitor) {
45
		visitor.visit(this);
46
	}
47
48
	/**
49
	 * {@inheritDoc}
50
	 */
51
	@Override
52
	MappedSuperclass getManagedType() {
53
		return (MappedSuperclass) super.getManagedType();
54
	}
55
}
(-)src/org/eclipse/jpt/jpa/core/internal/jpql/JpaMapping.java (+245 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2011 Oracle. All rights reserved.
3
 * This program and the accompanying materials are made available under the 
4
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
5
 * which accompanies this distribution. 
6
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
7
 * and the Eclipse Distribution License is available at 
8
 * http://www.eclipse.org/org/documents/edl-v10.php.
9
 *
10
 * Contributors:
11
 *     Oracle - initial API and implementation
12
 *
13
 ******************************************************************************/
14
package org.eclipse.jpt.jpa.core.internal.jpql;
15
16
import java.lang.annotation.Annotation;
17
import java.util.Iterator;
18
import java.util.List;
19
import org.eclipse.jpt.common.utility.internal.CollectionTools;
20
import org.eclipse.jpt.common.utility.internal.StringTools;
21
import org.eclipse.jpt.common.utility.internal.iterators.TransformationIterator;
22
import org.eclipse.jpt.jpa.core.MappingKeys;
23
import org.eclipse.jpt.jpa.core.context.AttributeMapping;
24
import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
25
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
26
import org.eclipse.jpt.jpa.core.jpa2.MappingKeys2_0;
27
import org.eclipse.jpt.jpa.core.resource.java.JavaResourcePersistentAttribute;
28
import org.eclipse.persistence.jpa.jpql.spi.IManagedType;
29
import org.eclipse.persistence.jpa.jpql.spi.IMapping;
30
import org.eclipse.persistence.jpa.jpql.spi.IMappingType;
31
import org.eclipse.persistence.jpa.jpql.spi.IType;
32
import org.eclipse.persistence.jpa.jpql.spi.ITypeDeclaration;
33
34
/**
35
 * The concrete implementation of {@link IMapping} that is wrapping the design-time representation
36
 * of a mapping.
37
 *
38
 * @version 3.0
39
 * @since 3.0
40
 * @author Pascal Filion
41
 */
42
@SuppressWarnings("nls")
43
final class JpaMapping implements IMapping {
44
45
	/**
46
	 * The design-time {@link AttributeMapping} wrapped by this class.
47
	 */
48
	private final AttributeMapping mapping;
49
50
	/**
51
	 * The type of the actual mapping.
52
	 */
53
	private IMappingType mappingType;
54
55
	/**
56
	 * The parent of this mapping.
57
	 */
58
	private final JpaManagedType parent;
59
60
	/**
61
	 * The type declaration of the property represented by the mapping.
62
	 */
63
	private ITypeDeclaration typeDeclaration;
64
65
	/**
66
	 * Creates a new <code>JpaMapping</code>.
67
	 *
68
	 * @param parent The parent of this mapping
69
	 * @param mapping The design-time {@link AttributeMapping} wrapped by this class
70
	 */
71
	JpaMapping(JpaManagedType parent, AttributeMapping mapping) {
72
		super();
73
		this.parent  = parent;
74
		this.mapping = mapping;
75
	}
76
77
	private Iterator<ITypeDeclaration> buildGenericTypeDeclarations(JavaResourcePersistentAttribute resource) {
78
		return new TransformationIterator<String, ITypeDeclaration>(resource.typeTypeArgumentNames()) {
79
			@Override
80
			protected ITypeDeclaration transform(String next) {
81
				return getTypeRepository().getType(next).getTypeDeclaration();
82
			}
83
		};
84
	}
85
86
	private ITypeDeclaration[] buildGenericTypeDeclarations() {
87
		JavaPersistentAttribute javaPersistentAttribute = mapping.getPersistentAttribute().getJavaPersistentAttribute();
88
		JavaResourcePersistentAttribute resource = javaPersistentAttribute.getResourcePersistentAttribute();
89
		List<ITypeDeclaration> declarations = CollectionTools.list(buildGenericTypeDeclarations(resource));
90
		return declarations.toArray(new ITypeDeclaration[declarations.size()]);
91
	}
92
93
	private ITypeDeclaration buildTypeDeclaration() {
94
		return new JpaTypeDeclaration(
95
			getTypeRepository().getType(mapping.getPersistentAttribute().getTypeName()),
96
			buildGenericTypeDeclarations(),
97
			false /*TODO*/
98
		);
99
	}
100
101
	/**
102
	 * {@inheritDoc}
103
	 */
104
	public IMappingType getMappingType() {
105
		if (mappingType == null) {
106
			mappingType = mappingType();
107
		}
108
		return mappingType;
109
	}
110
111
	/**
112
	 * {@inheritDoc}
113
	 */
114
	public String getName() {
115
		return mapping.getName();
116
	}
117
118
	/**
119
	 * {@inheritDoc}
120
	 */
121
	public IManagedType getParent() {
122
		return parent;
123
	}
124
125
	/**
126
	 * {@inheritDoc}
127
	 */
128
	public IType getType() {
129
		PersistentAttribute property = mapping.getPersistentAttribute();
130
		return getTypeRepository().getType(property.getTypeName());
131
	}
132
133
	/**
134
	 * {@inheritDoc}
135
	 */
136
	public ITypeDeclaration getTypeDeclaration() {
137
		if (typeDeclaration == null) {
138
			typeDeclaration = buildTypeDeclaration();
139
		}
140
		return typeDeclaration;
141
	}
142
143
	private JpaTypeRepository getTypeRepository() {
144
		return parent.getType().getTypeRepository();
145
	}
146
147
	/**
148
	 * {@inheritDoc}
149
	 */
150
	public boolean hasAnnotation(Class<? extends Annotation> annotationType) {
151
		JavaResourcePersistentAttribute attribute = mapping.getPersistentAttribute().getJavaPersistentAttribute().getResourcePersistentAttribute();
152
		return attribute.getAnnotation(annotationType.getName()) != null;
153
	}
154
155
	private IMappingType mappingType() {
156
157
		String type = mapping.getKey();
158
159
		// Basic
160
		if (type == MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY) {
161
			return IMappingType.BASIC;
162
		}
163
164
		// Embedded
165
		if (type == MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY) {
166
			return IMappingType.EMBEDDED;
167
		}
168
169
		// Embedded Id
170
		if (type == MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY) {
171
			return IMappingType.EMBEDDED_ID;
172
		}
173
174
		// Id
175
		if (type == MappingKeys.ID_ATTRIBUTE_MAPPING_KEY) {
176
			return IMappingType.ID;
177
		}
178
179
		// M:M
180
		if (type == MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY) {
181
			return IMappingType.MANY_TO_MANY;
182
		}
183
184
		// 1:M
185
		if (type == MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY) {
186
			return IMappingType.ONE_TO_MANY;
187
		}
188
189
		// M:1
190
		if (type == MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY) {
191
			return IMappingType.MANY_TO_ONE;
192
		}
193
194
		// 1:1
195
		if (type == MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY) {
196
			return IMappingType.ONE_TO_ONE;
197
		}
198
199
		// Version
200
		if (type == MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY) {
201
			return IMappingType.VERSION;
202
		}
203
204
		// Element Collection
205
		if (type == MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY) {
206
			return IMappingType.ELEMENT_COLLECTION;
207
		}
208
209
		// Basic Collection
210
//		if (type == EclipseLinkMappingKeys.BASIC_COLLECTION_ATTRIBUTE_MAPPING_KEY) {
211
//			return IMappingType.BASIC_COLLECTION;
212
//		}
213
//
214
//		// Basic Map
215
//		if (type == EclipseLinkMappingKeys.BASIC_MAP_ATTRIBUTE_MAPPING_KEY) {
216
//			return IMappingType.BASIC_MAP;
217
//		}
218
//
219
//		// Transformation
220
//		if (type == EclipseLinkMappingKeys.TRANSFORMATION_ATTRIBUTE_MAPPING_KEY) {
221
//			return IMappingType.TRANSFORMATION;
222
//		}
223
//
224
//		// Variable 1:1
225
//		if (type == EclipseLinkMappingKeys.VARIABLE_ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY) {
226
//			return IMappingType.VARIABLE_ONE_TO_ONE;
227
//		}
228
229
		return IMappingType.TRANSIENT;
230
	}
231
232
	/**
233
	 * {@inheritDoc}
234
	 */
235
	@Override
236
	public String toString() {
237
		StringBuilder sb = new StringBuilder();
238
		StringTools.buildSimpleToStringOn(this, sb);
239
		sb.append("name=");
240
		sb.append(getName());
241
		sb.append(", mappingType=");
242
		sb.append(getMappingType());
243
		return sb.toString();
244
	}
245
}
(-)src/org/eclipse/jpt/jpa/core/internal/jpql/JpaMappingFile.java (+65 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2011 Oracle. All rights reserved.
3
 * This program and the accompanying materials are made available under the 
4
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
5
 * which accompanies this distribution. 
6
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
7
 * and the Eclipse Distribution License is available at 
8
 * http://www.eclipse.org/org/documents/edl-v10.php.
9
 *
10
 * Contributors:
11
 *     Oracle - initial API and implementation
12
 *
13
 ******************************************************************************/
14
package org.eclipse.jpt.jpa.core.internal.jpql;
15
16
import java.util.Iterator;
17
import org.eclipse.jpt.jpa.core.JpaProject;
18
import org.eclipse.jpt.jpa.core.context.Entity;
19
import org.eclipse.jpt.jpa.core.context.MappingFile;
20
import org.eclipse.jpt.jpa.core.context.PersistentType;
21
import org.eclipse.jpt.jpa.core.context.TypeMapping;
22
23
/**
24
 * The concrete implementation that is wrapping the design-time representation of a mapping file.
25
 *
26
 * @version 3.0
27
 * @since 3.0
28
 * @author Pascal Filion
29
 */
30
public class JpaMappingFile extends JpaManagedTypeProvider {
31
32
	/**
33
	 * Creates a new <code>JpaMappingFile</code>.
34
	 * 
35
	 * @param jpaProject The project that gives access to the application's metadata
36
	 * @param persistentTypeContainer The design-time provider of managed types
37
	 */
38
	public JpaMappingFile(JpaProject jpaProject, MappingFile persistentTypeContainer) {
39
		super(jpaProject, persistentTypeContainer);
40
	}
41
42
	/**
43
	 * {@inheritDoc}
44
	 */
45
	@Override
46
	JpaEntity buildEntity(TypeMapping mappedClass) {
47
		return new JpaOrmEntity(this, (Entity) mappedClass);
48
	}
49
50
	/**
51
	 * {@inheritDoc}
52
	 */
53
	@Override
54
	protected MappingFile getPersistentTypeContainer() {
55
		return (MappingFile) super.getPersistentTypeContainer();
56
	}
57
58
	/**
59
	 * {@inheritDoc}
60
	 */
61
	@Override
62
	protected Iterator<? extends PersistentType> persistenceTypes() {
63
		return getPersistentTypeContainer().getPersistentTypes().iterator();
64
	}
65
}
(-)src/org/eclipse/jpt/jpa/core/internal/jpql/JpaNullManagedType.java (+90 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2011 Oracle. All rights reserved.
3
 * This program and the accompanying materials are made available under the 
4
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
5
 * which accompanies this distribution. 
6
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
7
 * and the Eclipse Distribution License is available at 
8
 * http://www.eclipse.org/org/documents/edl-v10.php.
9
 *
10
 * Contributors:
11
 *     Oracle - initial API and implementation
12
 *
13
 ******************************************************************************/
14
package org.eclipse.jpt.jpa.core.internal.jpql;
15
16
import java.util.Iterator;
17
import org.eclipse.jpt.common.utility.internal.iterators.EmptyIterator;
18
import org.eclipse.jpt.jpa.core.context.TypeMapping;
19
import org.eclipse.persistence.jpa.jpql.spi.IManagedType;
20
import org.eclipse.persistence.jpa.jpql.spi.IManagedTypeProvider;
21
import org.eclipse.persistence.jpa.jpql.spi.IManagedTypeVisitor;
22
import org.eclipse.persistence.jpa.jpql.spi.IMapping;
23
import org.eclipse.persistence.jpa.jpql.spi.IType;
24
25
/**
26
 * The concrete implementation of {@link IManagedType} that is wrapping the design-time
27
 * representation a "null" managed type.
28
 *
29
 * @version 3.0
30
 * @since 3.0
31
 * @author Pascal Filion
32
 */
33
final class JpaNullManagedType implements IManagedType {
34
35
	/**
36
	 * The provider of JPA managed types.
37
	 */
38
	private final JpaManagedTypeProvider provider;
39
40
	/**
41
	 * The design-time model object wrapped by this class.
42
	 */
43
	private final TypeMapping typeMapping;
44
45
	/**
46
	 * Creates a new <code>JpaNullManagedType</code>.
47
	 *
48
	 * @param managedType The provider of JPA managed types
49
	 * @param typeMapping The design-time model object wrapped by this class
50
	 */
51
	JpaNullManagedType(JpaManagedTypeProvider provider, TypeMapping typeMapping) {
52
		super();
53
		this.provider    = provider;
54
		this.typeMapping = typeMapping;
55
	}
56
57
	/**
58
	 * {@inheritDoc}
59
	 */
60
	public void accept(IManagedTypeVisitor visitor) {
61
	}
62
63
	/**
64
	 * {@inheritDoc}
65
	 */
66
	public IMapping getMappingNamed(String name) {
67
		return null;
68
	}
69
70
	/**
71
	 * {@inheritDoc}
72
	 */
73
	public IManagedTypeProvider getProvider() {
74
		return provider;
75
	}
76
77
	/**
78
	 * {@inheritDoc}
79
	 */
80
	public IType getType() {
81
		return provider.getTypeRepository().getType(typeMapping.getPersistentType().getName());
82
	}
83
84
	/**
85
	 * {@inheritDoc}
86
	 */
87
	public Iterator<IMapping> mappings() {
88
		return EmptyIterator.instance();
89
	}
90
}
(-)src/org/eclipse/jpt/jpa/core/internal/jpql/JpaOrmEntity.java (+59 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2011 Oracle. All rights reserved.
3
 * 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
 *******************************************************************************/
10
package org.eclipse.jpt.jpa.core.internal.jpql;
11
12
import java.util.ListIterator;
13
import java.util.Map;
14
import org.eclipse.jpt.jpa.core.context.Entity;
15
import org.eclipse.jpt.jpa.core.context.NamedQuery;
16
import org.eclipse.jpt.jpa.core.context.java.JavaTypeMapping;
17
import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
18
import org.eclipse.persistence.jpa.jpql.spi.IQuery;
19
20
/**
21
 * The concrete implementation of {@link IEntity} that is wrapping the design-time representation
22
 * of a JPA entity defined in an ORM configuration.
23
 *
24
 * @version 3.0
25
 * @since 3.0
26
 * @author Pascal Filion
27
 */
28
final class JpaOrmEntity extends JpaEntity {
29
30
	/**
31
	 * Creates a new <code>JpaOrmEntity</code>.
32
	 *
33
	 * @param provider The provider of JPA managed types
34
	 * @param entity The design-time model object wrapped by this class
35
	 */
36
	JpaOrmEntity(JpaMappingFile provider, Entity entity) {
37
		super(provider, entity);
38
	}
39
40
	/**
41
	 * {@inheritDoc}
42
	 */
43
	@Override
44
	void initializeQueries(Map<String, IQuery> queries) {
45
		super.initializeQueries(queries);
46
47
		JpaManagedTypeProvider provider = getProvider();
48
		OrmPersistentType type = (OrmPersistentType) getManagedType().getPersistentType();
49
		JavaTypeMapping mapping = type.getJavaPersistentType().getMapping();
50
51
		if (mapping instanceof Entity) {
52
			Entity entity = (Entity) mapping;
53
			for (ListIterator<NamedQuery> iter = entity.getQueryContainer().namedQueries(); iter.hasNext(); ) {
54
				NamedQuery namedQuery = iter.next();
55
				queries.put(namedQuery.getName(), buildQuery(provider, namedQuery));
56
			}
57
		}
58
	}
59
}
(-)src/org/eclipse/jpt/jpa/core/internal/jpql/JpaPersistenceUnit.java (+81 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2011 Oracle. All rights reserved.
3
 * This program and the accompanying materials are made available under the 
4
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
5
 * which accompanies this distribution. 
6
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
7
 * and the Eclipse Distribution License is available at 
8
 * http://www.eclipse.org/org/documents/edl-v10.php.
9
 *
10
 * Contributors:
11
 *     Oracle - initial API and implementation
12
 *
13
 ******************************************************************************/
14
package org.eclipse.jpt.jpa.core.internal.jpql;
15
16
import java.util.Iterator;
17
import org.eclipse.jpt.common.utility.internal.iterators.CompositeIterator;
18
import org.eclipse.jpt.common.utility.internal.iterators.TransformationIterator;
19
import org.eclipse.jpt.jpa.core.JpaProject;
20
import org.eclipse.jpt.jpa.core.context.Entity;
21
import org.eclipse.jpt.jpa.core.context.PersistentType;
22
import org.eclipse.jpt.jpa.core.context.TypeMapping;
23
import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
24
import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
25
26
/**
27
 * The concrete implementation that is wrapping the design-time representation of a persistence unit.
28
 *
29
 * @version 3.0
30
 * @since 3.0
31
 * @author Pascal Filion
32
 */
33
public final class JpaPersistenceUnit extends JpaManagedTypeProvider {
34
35
	/**
36
	 * Creates a new <code>JpaPersistenceUnit</code>.
37
	 *
38
	 * @param jpaProject The project that gives access to the application's metadata
39
	 * @param persistentUnit The design-time persistence unit
40
	 */
41
	public JpaPersistenceUnit(JpaProject jpaProject, PersistenceUnit persistentUnit) {
42
		super(jpaProject, persistentUnit);
43
	}
44
45
	@Override
46
	/**
47
	 * {@inheritDoc}
48
	 */
49
	JpaEntity buildEntity(TypeMapping mappedClass) {
50
		return new JpaPersistenceUnitEntity(this, (Entity) mappedClass);
51
	}
52
53
	/**
54
	 * {@inheritDoc}
55
	 */
56
	@Override
57
	PersistenceUnit getPersistentTypeContainer() {
58
		return (PersistenceUnit) super.getPersistentTypeContainer();
59
	}
60
61
	@SuppressWarnings("unchecked")
62
	private Iterator<ClassRef> javaClassRefs() {
63
		return new CompositeIterator<ClassRef>(
64
			getPersistentTypeContainer().specifiedClassRefs(),
65
			getPersistentTypeContainer().impliedClassRefs()
66
		);
67
	}
68
69
	/**
70
	 * {@inheritDoc}
71
	 */
72
	@Override
73
	Iterator<? extends PersistentType> persistenceTypes() {
74
		return new TransformationIterator<ClassRef, PersistentType>(javaClassRefs()) {
75
			@Override
76
			protected PersistentType transform(ClassRef classRef) {
77
				return classRef.getJavaPersistentType();
78
			}
79
		};
80
	}
81
}
(-)src/org/eclipse/jpt/jpa/core/internal/jpql/JpaPersistenceUnitEntity.java (+33 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2011 Oracle. All rights reserved.
3
 * 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
 *******************************************************************************/
10
package org.eclipse.jpt.jpa.core.internal.jpql;
11
12
import org.eclipse.jpt.jpa.core.context.Entity;
13
14
/**
15
 * The concrete implementation of {@link IEntity} that is wrapping the design-time representation
16
 * of a JPA entity defined in a persistence unit.
17
 *
18
 * @version 3.0
19
 * @since 3.0
20
 * @author Pascal Filion
21
 */
22
final class JpaPersistenceUnitEntity extends JpaEntity {
23
24
	/**
25
	 * Creates a new <code>JpaPersistenceUnitEntity</code>.
26
	 *
27
	 * @param provider The provider of JPA managed types
28
	 * @param entity The design-time model object wrapped by this class
29
	 */
30
	JpaPersistenceUnitEntity(JpaManagedTypeProvider provider, Entity entity) {
31
		super(provider, entity);
32
	}
33
}
(-)src/org/eclipse/jpt/jpa/core/internal/jpql/JpaQuery.java (+115 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2011 Oracle. All rights reserved.
3
 * This program and the accompanying materials are made available under the 
4
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
5
 * which accompanies this distribution. 
6
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
7
 * and the Eclipse Distribution License is available at 
8
 * http://www.eclipse.org/org/documents/edl-v10.php.
9
 *
10
 * Contributors:
11
 *     Oracle - initial API and implementation
12
 *
13
 ******************************************************************************/
14
package org.eclipse.jpt.jpa.core.internal.jpql;
15
16
import org.eclipse.jpt.common.utility.internal.StringTools;
17
import org.eclipse.jpt.jpa.core.context.NamedQuery;
18
import org.eclipse.persistence.jpa.jpql.spi.IQuery;
19
20
/**
21
 * The concrete implementation of {@link IQuery} that is wrapping the design-time representation
22
 * of a JPQL query.
23
 *
24
 * @version 3.0
25
 * @since 3.0
26
 * @author Pascal Filion
27
 */
28
@SuppressWarnings("nls")
29
public final class JpaQuery implements IQuery {
30
31
	/**
32
	 * The actual JPQL query, which can differ from the one owned by the model object, which happens
33
	 * when the model is out of sync because it has not been updated yet.
34
	 */
35
	private String actualQuery;
36
37
	/**
38
	 *  The provider of managed types.
39
	 */
40
	private JpaManagedTypeProvider provider;
41
42
	/**
43
	 * The model object holding onto the JPQL query.
44
	 */
45
	private NamedQuery query;
46
47
	/**
48
	 * Creates a new <code>JpaQuery</code>.
49
	 *
50
	 * @param provider The provider of managed types
51
	 * @param query The model object of the JPQL query
52
	 */
53
	public JpaQuery(JpaManagedTypeProvider provider, NamedQuery query) {
54
		this(provider, query, query.getQuery());
55
	}
56
57
	/**
58
	 * Creates a new <code>JpaQuery</code>.
59
	 *
60
	 * @param provider The provider of managed types
61
	 * @param query The model object of the JPQL query
62
	 * @param actualQuery The actual JPQL query, which can differ from the one owned by the model
63
	 * object, which happens when the model is out of sync because it has not been updated yet
64
	 */
65
	JpaQuery(JpaManagedTypeProvider provider, NamedQuery query, String actualQuery) {
66
		super();
67
		initialize(provider, query, actualQuery);
68
	}
69
70
	/**
71
	 * {@inheritDoc}
72
	 */
73
	public String getExpression() {
74
		return actualQuery;
75
	}
76
77
	/**
78
	 * {@inheritDoc}
79
	 */
80
	public JpaManagedTypeProvider getProvider() {
81
		return provider;
82
	}
83
84
	/**
85
	 * Returns the encapsulated {@link NamedQuery}, which is the actual object.
86
	 *
87
	 * @return The design-time representation of a JPQL query
88
	 */
89
	NamedQuery getQuery() {
90
		return query;
91
	}
92
93
	private void initialize(JpaManagedTypeProvider provider, NamedQuery query, String actualQuery) {
94
95
		this.query       = query;
96
		this.provider    = provider;
97
		this.actualQuery = actualQuery;
98
99
		if (this.actualQuery == null) {
100
			this.actualQuery = StringTools.EMPTY_STRING;
101
		}
102
	}
103
104
	/**
105
	 * {@inheritDoc}
106
	 */
107
	@Override
108
	public String toString() {
109
		StringBuilder sb = new StringBuilder();
110
		sb.append(super.toString());
111
		sb.append(", query=");
112
		sb.append(getExpression());
113
		return sb.toString();
114
	}
115
}
(-)src/org/eclipse/jpt/jpa/core/internal/jpql/JpaType.java (+362 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2011 Oracle. All rights reserved.
3
 * This program and the accompanying materials are made available under the 
4
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
5
 * which accompanies this distribution. 
6
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
7
 * and the Eclipse Distribution License is available at 
8
 * http://www.eclipse.org/org/documents/edl-v10.php.
9
 *
10
 * Contributors:
11
 *     Oracle - initial API and implementation
12
 *
13
 ******************************************************************************/
14
package org.eclipse.jpt.jpa.core.internal.jpql;
15
16
import java.lang.annotation.Annotation;
17
import java.util.ArrayList;
18
import java.util.Collection;
19
import java.util.Collections;
20
import java.util.Iterator;
21
import java.util.List;
22
import org.eclipse.core.runtime.NullProgressMonitor;
23
import org.eclipse.jdt.core.IField;
24
import org.eclipse.jdt.core.IJavaElement;
25
import org.eclipse.jdt.core.IType;
26
import org.eclipse.jdt.core.ITypeHierarchy;
27
import org.eclipse.jdt.core.dom.AST;
28
import org.eclipse.jdt.core.dom.ASTNode;
29
import org.eclipse.jdt.core.dom.ASTParser;
30
import org.eclipse.jdt.core.dom.ASTVisitor;
31
import org.eclipse.jdt.core.dom.MethodDeclaration;
32
import org.eclipse.jpt.common.utility.internal.StringTools;
33
import org.eclipse.persistence.jpa.jpql.ExpressionTools;
34
import org.eclipse.persistence.jpa.jpql.spi.IConstructor;
35
import org.eclipse.persistence.jpa.jpql.spi.ITypeDeclaration;
36
37
/**
38
 * The concrete implementation of {@link org.eclipse.persistence.jpa.query.spi.IType IType} that is
39
 * wrapping the design-time representation of a Java type.
40
 *
41
 * @version 3.0
42
 * @since 3.0
43
 * @author Pascal Filion
44
 */
45
final class JpaType implements org.eclipse.persistence.jpa.jpql.spi.IType {
46
47
	/**
48
	 * The cached collection of {@link IConstructor constructors}.
49
	 */
50
	private Collection<IConstructor> constructors;
51
52
	/**
53
	 * The list of names for the {@link Enum}'s constants otherwise an empty array.
54
	 */
55
	private String[] enumConstants;
56
57
	/**
58
	 * The actual Java type.
59
	 */
60
	private Class<?> javaType;
61
62
	/**
63
	 * The design-time representation of a Java type.
64
	 */
65
	private IType type;
66
67
	/**
68
	 * Caches the type hierarchy of the {@link IType} in order to prevent rebuilding it each time.
69
	 */
70
	private ITypeDeclaration typeDeclaration;
71
72
	/**
73
	 * Caches the type hierarchy of the {@link IType} in order to prevent rebuilding it each time
74
	 * {@link #isAssignableTo(org.eclipse.persistence.jpa.query.spi.IType)} is called.
75
	 */
76
	private ITypeHierarchy typeHierarchy;
77
78
	/**
79
	 * The fully qualified name of the Java type.
80
	 */
81
	private final String typeName;
82
83
	/**
84
	 * The external form of a type repository.
85
	 */
86
	private final JpaTypeRepository typeRepository;
87
88
	/**
89
	 * Creates a new <code>JpaType</code>.
90
	 *
91
	 * @param typeRepository The external form of a type repository
92
	 * @param javaType The actual Java type
93
	 */
94
	JpaType(JpaTypeRepository typeRepository, Class<?> javaType) {
95
		this(typeRepository, javaType.getName());
96
		this.javaType = javaType;
97
	}
98
99
	/**
100
	 * Creates a new <code>JpaType</code>.
101
	 *
102
	 * @param typeRepository The external form of a type repository
103
	 * @param type The design-time representation of a Java type
104
	 */
105
	JpaType(JpaTypeRepository typeRepository, IType type) {
106
		this(typeRepository, type.getFullyQualifiedName());
107
		this.type = type;
108
	}
109
110
	/**
111
	 * Creates a new <code>JpaType</code>.
112
	 *
113
	 * @param typeRepository The external form of a type repository
114
	 * @param typeName The fully qualified name of the Java type
115
	 */
116
	JpaType(JpaTypeRepository typeRepository, String typeName) {
117
		super();
118
		this.typeName       = typeName;
119
		this.typeRepository = typeRepository;
120
	}
121
122
	private ASTNode buildASTNode() {
123
		
124
		ASTParser parser = ASTParser.newParser(AST.JLS3);
125
126
		if (type.getElementType() == IJavaElement.CLASS_FILE) {
127
			parser.setSource(type.getClassFile());
128
		}
129
		else {
130
			parser.setSource(type.getTypeRoot());
131
		}
132
133
		parser.setIgnoreMethodBodies(true); // we don't need method bodies
134
		parser.setResolveBindings(true);
135
		parser.setBindingsRecovery(true); // see bugs 196200, 222735
136
137
		return parser.createAST(new NullProgressMonitor());
138
	}
139
140
	private IConstructor buildConstructor(MethodDeclaration method) {
141
		return new JpaConstructor(typeRepository, method);
142
	}
143
144
	private Collection<IConstructor> buildConstructors() {
145
146
		if (type == null) {
147
			return Collections.emptyList();
148
		}
149
150
		final Collection<IConstructor> constructors = new ArrayList<IConstructor>();
151
		ASTNode astNode = buildASTNode();
152
153
		astNode.accept(new ASTVisitor() {
154
					@Override
155
					public boolean visit(MethodDeclaration node) {
156
				if (node.isConstructor()) {
157
					constructors.add(buildConstructor(node));
158
				}
159
				return true;
160
			}
161
		});
162
163
		return constructors;
164
	}
165
166
	private String[] buildEnumConstants() {
167
168
		try {
169
			if ((type != null) && type.isEnum()) {
170
171
				List<String> names = new ArrayList<String>();
172
173
				for (IField field : type.getFields()) {
174
					if (field.isEnumConstant()) {
175
						names.add(field.getElementName());
176
					}
177
				}
178
179
				return names.toArray(new String[names.size()]);
180
			}
181
		}
182
		catch (Exception e) {
183
			// Just ignore and return an empty array
184
		}
185
186
		return ExpressionTools.EMPTY_STRING_ARRAY;
187
	}
188
189
	private ITypeDeclaration buildTypeDeclaration() {
190
		return new JpaTypeDeclaration(this, new ITypeDeclaration[0], false);
191
	}
192
193
	/**
194
	 * {@inheritDoc}
195
	 */
196
	public Iterator<IConstructor> constructors() {
197
		if (constructors == null) {
198
			constructors = buildConstructors();
199
		}
200
		return constructors.iterator();
201
	}
202
203
	/**
204
	 * {@inheritDoc}
205
	 */
206
	@Override
207
	public boolean equals(Object object) {
208
		return (this == object) || equals((org.eclipse.persistence.jpa.jpql.spi.IType) object);
209
	}
210
211
	/**
212
	 * {@inheritDoc}
213
	 */
214
	public boolean equals(org.eclipse.persistence.jpa.jpql.spi.IType type) {
215
		return (this == type) || typeName.equals(type.getName());
216
	}
217
218
	/**
219
	 * {@inheritDoc}
220
	 */
221
	public String[] getEnumConstants() {
222
		if (enumConstants == null) {
223
			enumConstants = buildEnumConstants();
224
		}
225
		return enumConstants;
226
	}
227
228
	/**
229
	 * Returns the encapsulated Java {@link Class}, which is the actual type.
230
	 *
231
	 * @return The actual Java type
232
	 */
233
	Class<?> getJavaType() {
234
		return javaType;
235
	}
236
237
	/**
238
	 * {@inheritDoc}
239
	 */
240
	public String getName() {
241
		return typeName;
242
	}
243
244
	/**
245
	 * Returns the encapsulated {@link Type}, which is the actual type.
246
	 *
247
	 * @return The design-time representation of a Java type
248
	 */
249
	IType getType() {
250
		return type;
251
	}
252
253
	/**
254
	 * {@inheritDoc}
255
	 */
256
	public ITypeDeclaration getTypeDeclaration() {
257
		if (typeDeclaration == null) {
258
			typeDeclaration = buildTypeDeclaration();
259
		}
260
		return typeDeclaration;
261
	}
262
263
	/**
264
	 * Returns the repository that gives access to the application's classes.
265
	 *
266
	 * @return The external form of the type repository
267
	 */
268
	JpaTypeRepository getTypeRepository() {
269
		return typeRepository;
270
	}
271
272
	/**
273
	 * {@inheritDoc}
274
	 */
275
	public boolean hasAnnotation(Class<? extends Annotation> annotationType) {
276
277
		if (type != null) {
278
			return type.getAnnotation(annotationType.getName()) != null;
279
		}
280
281
		if (javaType != null) {
282
			return javaType.isAnnotationPresent(annotationType);
283
		}
284
285
		return false;
286
	}
287
288
	/**
289
	 * {@inheritDoc}
290
	 */
291
	@Override
292
	public int hashCode() {
293
		return typeName.hashCode();
294
	}
295
296
	/**
297
	 * {@inheritDoc}
298
	 */
299
	public boolean isAssignableTo(org.eclipse.persistence.jpa.jpql.spi.IType type) {
300
301
		if (this == type) {
302
			return true;
303
		}
304
305
		JpaType jpaType = (JpaType) type;
306
307
		// Dealing with two IType
308
		if ((this.type != null) && (jpaType.type != null)) {
309
			try {
310
				// TODO: Use ASTTools.typeIsSubTypeOf() instead
311
				if (typeHierarchy == null) {
312
					typeHierarchy = this.type.newTypeHierarchy(new NullProgressMonitor());
313
				}
314
				return typeHierarchy.contains(jpaType.type);
315
			}
316
			catch (Exception e) {
317
				return false;
318
			}
319
		}
320
321
		// Dealing with two Class<?>
322
		if ((javaType != null) && (jpaType.javaType != null)) {
323
			return jpaType.javaType.isAssignableFrom(javaType);
324
		}
325
326
		// Anything else is always false
327
		return false;
328
	}
329
330
	/**
331
	 * {@inheritDoc}
332
	 */
333
	public boolean isEnum() {
334
335
		if (javaType != null) {
336
			return javaType.isEnum();
337
		}
338
339
		try {
340
			return (type != null) ? type.isEnum() : false;
341
		}
342
		catch (Exception e) {
343
			// Simply ignore and return no
344
			return false;
345
		}
346
	}
347
348
	/**
349
	 * {@inheritDoc}
350
	 */
351
	public boolean isResolvable() {
352
		return (type != null) || (javaType != null);
353
	}
354
355
	/**
356
	 * {@inheritDoc}
357
	 */
358
	@Override
359
	public String toString() {
360
		return StringTools.buildToStringFor(this, typeName);
361
	}
362
}
(-)src/org/eclipse/jpt/jpa/core/internal/jpql/JpaTypeDeclaration.java (+94 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2011 Oracle. All rights reserved.
3
 * This program and the accompanying materials are made available under the 
4
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
5
 * which accompanies this distribution. 
6
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
7
 * and the Eclipse Distribution License is available at 
8
 * http://www.eclipse.org/org/documents/edl-v10.php.
9
 *
10
 * Contributors:
11
 *     Oracle - initial API and implementation
12
 *
13
 ******************************************************************************/
14
package org.eclipse.jpt.jpa.core.internal.jpql;
15
16
import org.eclipse.persistence.jpa.jpql.spi.IType;
17
import org.eclipse.persistence.jpa.jpql.spi.ITypeDeclaration;
18
19
/**
20
 * The concrete implementation of {@link ITypeDeclaration} that is wrapping the design-time
21
 * representation of the declaration description of a type.
22
 *
23
 * @version 3.0
24
 * @since 3.0
25
 * @author Pascal Filion
26
 */
27
final class JpaTypeDeclaration implements ITypeDeclaration {
28
29
	/**
30
	 * Determines whether this type represents an array or not.
31
	 */
32
	private boolean array;
33
34
	/**
35
	 * The generics of the given type or an empty list if the type is not parameterized.
36
	 */
37
	private final ITypeDeclaration[] genericTypes;
38
39
	/**
40
	 * The external form of the Java type.
41
	 */
42
	private final IType type;
43
44
	/**
45
	 * Creates a new <code>JpaTypeDeclaration</code>.
46
	 *
47
	 * @param type The external form of the Java type
48
	 * @param genericTypes The generics of the given type or an empty list if the type is not
49
	 * parameterized
50
	 * @param array Determines whether this type represents an array or not
51
	 */
52
	JpaTypeDeclaration(IType type, ITypeDeclaration[] genericTypes, boolean array) {
53
		super();
54
		this.type         = type;
55
		this.genericTypes = genericTypes;
56
		this.array        = array;
57
	}
58
59
	/**
60
	 * {@inheritDoc}
61
	 */
62
	public int getDimensionality() {
63
		return array ? 1 : 0; // TODO
64
	}
65
66
	/**
67
	 * {@inheritDoc}
68
	 */
69
	public IType getType() {
70
		return type;
71
	}
72
73
	/**
74
	 * {@inheritDoc}
75
	 */
76
	public ITypeDeclaration[] getTypeParameters() {
77
		return genericTypes;
78
	}
79
80
	/**
81
	 * {@inheritDoc}
82
	 */
83
	public boolean isArray() {
84
		return array;
85
	}
86
87
	/**
88
	 * {@inheritDoc}
89
	 */
90
	@Override
91
	public String toString() {
92
		return type.getName();
93
	}
94
}
(-)src/org/eclipse/jpt/jpa/core/internal/jpql/JpaTypeRepository.java (+290 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2011 Oracle. All rights reserved.
3
 * This program and the accompanying materials are made available under the 
4
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
5
 * which accompanies this distribution. 
6
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
7
 * and the Eclipse Distribution License is available at 
8
 * http://www.eclipse.org/org/documents/edl-v10.php.
9
 *
10
 * Contributors:
11
 *     Oracle - initial API and implementation
12
 *
13
 ******************************************************************************/
14
package org.eclipse.jpt.jpa.core.internal.jpql;
15
16
import java.util.HashMap;
17
import java.util.Map;
18
import org.eclipse.core.resources.IResource;
19
import org.eclipse.core.runtime.IPath;
20
import org.eclipse.jdt.core.IJavaProject;
21
import org.eclipse.jdt.core.JavaModelException;
22
import org.eclipse.persistence.jpa.jpql.TypeHelper;
23
import org.eclipse.persistence.jpa.jpql.spi.IType;
24
import org.eclipse.persistence.jpa.jpql.spi.ITypeRepository;
25
26
/**
27
 * The concrete implementation of {@link ITypeRepository} that is wrapping the design-time
28
 * representation of a type repository.
29
 *
30
 * @version 3.0
31
 * @since 3.0
32
 * @author Pascal Filion
33
 */
34
@SuppressWarnings("nls")
35
final class JpaTypeRepository implements ITypeRepository {
36
37
	/**
38
	 * The Java project that gives access the design-time objects representing the Java types.
39
	 */
40
	private final IJavaProject javaProject;
41
42
	/**
43
	 * Keeps a map of the primitives for fast access.
44
	 */
45
	private Map<String, Class<?>> primitives;
46
47
	/**
48
	 * The cached helper that is using this repository for retrieving {@link IType types}.
49
	 */
50
	private TypeHelper typeHelper;
51
52
	/**
53
	 * The types that have been cached for faster access.
54
	 */
55
	private final Map<String, JpaType> types;
56
57
	/**
58
	 * Creates a new <code>JpaTypeRepository</code>.
59
	 *
60
	 * @param javaProject The Java project that gives access the design-time objects representing
61
	 * the Java types
62
	 */
63
	JpaTypeRepository(IJavaProject javaProject) {
64
		super();
65
		this.javaProject = javaProject;
66
		this.types       = new HashMap<String, JpaType>();
67
	}
68
69
	private Map<String, Class<?>> buildPrimitives() {
70
		Map<String, Class<?>> primitives = new HashMap<String, Class<?>>();
71
		primitives.put(Byte     .TYPE.getName(), Byte     .TYPE);
72
		primitives.put(Short    .TYPE.getName(), Short    .TYPE);
73
		primitives.put(Character.TYPE.getName(), Character.TYPE);
74
		primitives.put(Integer  .TYPE.getName(), Integer  .TYPE);
75
		primitives.put(Long     .TYPE.getName(), Long     .TYPE);
76
		primitives.put(Float    .TYPE.getName(), Float    .TYPE);
77
		primitives.put(Double   .TYPE.getName(), Double   .TYPE);
78
		primitives.put(Boolean  .TYPE.getName(), Boolean  .TYPE);
79
		return primitives;
80
	}
81
82
	private JpaType buildType(Class<?> javaType) {
83
		JpaType jpaType = new JpaType(this, javaType);
84
		types.put(jpaType.getName(), jpaType);
85
		return jpaType;
86
	}
87
88
	private JpaType buildType(org.eclipse.jdt.core.IType type) {
89
		JpaType jpaType = new JpaType(this, type);
90
		types.put(jpaType.getName(), jpaType);
91
		return jpaType;
92
	}
93
94
	private JpaType buildType(String typeName) {
95
		return new JpaType(this, typeName);
96
	}
97
98
	private Class<?> findPrimitive(String typeName) {
99
		if (primitives == null) {
100
			primitives = buildPrimitives();
101
		}
102
		return primitives.get(typeName);
103
	}
104
105
	/**
106
	 * Retrieves the design-time Java type for the given type name, which has to be the fully
107
	 * qualified type name.
108
	 *
109
	 * @param typeName The fully qualified type name
110
	 * @return The design-time Java type if it could be retrieved; <code>null</code> otherwise
111
	 */
112
	private org.eclipse.jdt.core.IType findType(String typeName) {
113
		try {
114
			return javaProject.findType(typeName);
115
		}
116
		catch (JavaModelException e) {
117
			return null;
118
		}
119
	}
120
121
	/**
122
	 * {@inheritDoc}
123
	 */
124
	public JpaType getEnumType(String enumTypeName) {
125
126
		// Get the position of the last dot so we can remove the constant
127
		int lastDotIndex = enumTypeName.lastIndexOf(".");
128
129
		if (lastDotIndex == -1) {
130
			return null;
131
		}
132
133
		// Retrieve the fully qualified enum type name
134
		String typeName = enumTypeName.substring(0, lastDotIndex);
135
136
		// Attempt to load the enum type
137
		JpaType type = getType(typeName);
138
		return type.isEnum() ? type: null;
139
	}
140
141
	/**
142
	 * Returns
143
	 *
144
	 * @return
145
	 */
146
	IJavaProject getJavaProject() {
147
		return javaProject;
148
	}
149
150
	/**
151
	 * {@inheritDoc}
152
	 */
153
	public JpaType getType(Class<?> javaClass) {
154
		return getType(javaClass.getName());
155
	}
156
157
	/**
158
	 * Retrieves the {@link org.eclipse.jdt.core.IType IType} for the given {@link IResource}.
159
	 *
160
	 * @param resource The workspace location of the {@link org.eclipse.jdt.core.IType IType} to
161
	 * retrieve
162
	 * @return The design-time representation of a Java type
163
	 */
164
	org.eclipse.jdt.core.IType getType(IResource resource) {
165
		try {
166
			return (org.eclipse.jdt.core.IType) javaProject.findElement((IPath) resource);
167
		}
168
		catch (Exception e) {
169
			return null;
170
		}
171
	}
172
173
	/**
174
	 * Retrieves the {@link org.eclipse.jdt.core.IType IType} for the given {@link IResource}.
175
	 *
176
	 * @param resource The workspace location of the {@link org.eclipse.jdt.core.IType IType} to
177
	 * retrieve
178
	 * @return The design-time representation of a Java type
179
	 */
180
	IType getType(org.eclipse.jdt.core.IType type) {
181
		try {
182
			IType jpaType = types.get(type.getFullyQualifiedName());
183
			if (jpaType == null) {
184
				jpaType = buildType(type);
185
			}
186
			return jpaType;
187
		}
188
		catch (Exception e) {
189
			return null;
190
		}
191
	}
192
193
	/**
194
	 * {@inheritDoc}
195
	 */
196
	public JpaType getType(String typeName) {
197
		if (typeName.charAt(0) == '[') {
198
			return loadArrayType(typeName);
199
		}
200
		return loadTypeImp(typeName);
201
	}
202
203
	/**
204
	 * {@inheritDoc}
205
	 */
206
	public TypeHelper getTypeHelper() {
207
		if (typeHelper == null) {
208
			typeHelper = new TypeHelper(this);
209
		}
210
		return typeHelper;
211
	}
212
213
	private JpaType loadArrayType(String typeName) {
214
215
		JpaType type = types.get(typeName);
216
217
		if (type == null) {
218
			try {
219
				// Try to see if the type is a JDK class, otherwise, just use the type name
220
				// since IType doesn't support array types
221
				type = buildType(Class.forName(typeName));
222
			}
223
			catch (Exception e) {
224
				type = buildType(typeName);
225
			}
226
227
			types.put(typeName, type);
228
		}
229
230
		return type;
231
	}
232
233
	private JpaType loadInnerType(String typeName) {
234
235
		int index = typeName.lastIndexOf(".");
236
237
		if (index == -1) {
238
			return null;
239
		}
240
241
		StringBuilder sb = new StringBuilder();
242
		sb.append(typeName.substring(0, index));
243
		sb.append("$");
244
		sb.append(typeName.substring(index + 1, typeName.length()));
245
		typeName = sb.toString();
246
247
		JpaType type = types.get(typeName);
248
249
		if (type == null) {
250
			type = loadTypeImp(typeName);
251
		}
252
253
		return type;
254
	}
255
256
	private JpaType loadTypeImp(String typeName) {
257
258
		JpaType type = types.get(typeName);
259
260
		// The type was already cached, simply return it
261
		if (type != null) {
262
			return type;
263
		}
264
265
		// First check for primitive, they don't have a corresponding IType
266
		Class<?> primitive = findPrimitive(typeName);
267
268
		if (primitive != null) {
269
			return buildType(primitive);
270
		}
271
272
		// Attempt to load the Java type
273
		org.eclipse.jdt.core.IType iType = findType(typeName);
274
275
		// A Java type exists, return it
276
		if (iType != null) {
277
			return buildType(iType);
278
		}
279
280
		// Now try with a possible inner enum type
281
		type = loadInnerType(typeName);
282
283
		// No Java type exists, create a "null" IType
284
		if (type == null) {
285
			type = buildType(typeName);
286
		}
287
288
		return type;
289
	}
290
}
(-)AllJPQLQueryTests.launch (+313 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
3
<setAttribute key="additional_plugins"/>
4
<booleanAttribute key="append.args" value="true"/>
5
<booleanAttribute key="askclear" value="false"/>
6
<booleanAttribute key="automaticAdd" value="true"/>
7
<booleanAttribute key="automaticValidate" value="false"/>
8
<stringAttribute key="bootstrap" value=""/>
9
<stringAttribute key="checked" value="[NONE]"/>
10
<booleanAttribute key="clearConfig" value="true"/>
11
<booleanAttribute key="clearws" value="true"/>
12
<booleanAttribute key="clearwslog" value="false"/>
13
<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
14
<booleanAttribute key="default" value="true"/>
15
<stringAttribute key="featureDefaultLocation" value="workspace"/>
16
<stringAttribute key="featurePluginResolution" value="workspace"/>
17
<booleanAttribute key="includeOptional" value="true"/>
18
<stringAttribute key="location" value="${workspace_loc}/jpql-junit-workspace"/>
19
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
20
<listEntry value="/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpql/AllJPQLQueryTests.java"/>
21
</listAttribute>
22
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
23
<listEntry value="1"/>
24
</listAttribute>
25
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
26
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
27
</listAttribute>
28
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
29
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
30
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
31
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/>
32
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
33
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.jpt.jpa.core.tests.internal.jpql.AllJPQLQueryTests"/>
34
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
35
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.jpt.jpa.core.tests"/>
36
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
37
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m&#13;&#10;-Xmx1024m&#13;&#10;-XX:PermSize=64M&#13;&#10;-XX:MaxPermSize=128M &#13;&#10;-Dorg.eclipse.jpt.jpa.jar=${workspace_loc:/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/lib/persistence.jar}&#13;&#10;-Dorg.eclipse.jpt.eclipselink.jar=${workspace_loc:/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/lib/eclipselink.jar}&#13;&#10;-Dtest.query.jpql.resource.source=${workspace_loc:/org.eclipse.persistence.jpa.jpql.test/resource/source}"/>
38
<stringAttribute key="pde.version" value="3.3"/>
39
<stringAttribute key="product" value="org.eclipse.sdk.ide"/>
40
<booleanAttribute key="run_in_ui_thread" value="true"/>
41
<setAttribute key="selected_features">
42
<setEntry value="com.collabnet.subversion.merge.feature:default"/>
43
<setEntry value="com.sun.jna:default"/>
44
<setEntry value="org.eclipse.cvs.source:default"/>
45
<setEntry value="org.eclipse.cvs:default"/>
46
<setEntry value="org.eclipse.datatools.common.doc.user:default"/>
47
<setEntry value="org.eclipse.datatools.connectivity.doc.user:default"/>
48
<setEntry value="org.eclipse.datatools.connectivity.feature.source:default"/>
49
<setEntry value="org.eclipse.datatools.connectivity.feature:default"/>
50
<setEntry value="org.eclipse.datatools.connectivity.oda.designer.core.feature.source:default"/>
51
<setEntry value="org.eclipse.datatools.connectivity.oda.designer.core.feature:default"/>
52
<setEntry value="org.eclipse.datatools.connectivity.oda.designer.feature.source:default"/>
53
<setEntry value="org.eclipse.datatools.connectivity.oda.designer.feature:default"/>
54
<setEntry value="org.eclipse.datatools.connectivity.oda.feature.source:default"/>
55
<setEntry value="org.eclipse.datatools.connectivity.oda.feature:default"/>
56
<setEntry value="org.eclipse.datatools.doc.user:default"/>
57
<setEntry value="org.eclipse.datatools.enablement.apache.derby.feature.source:default"/>
58
<setEntry value="org.eclipse.datatools.enablement.apache.derby.feature:default"/>
59
<setEntry value="org.eclipse.datatools.enablement.feature.source:default"/>
60
<setEntry value="org.eclipse.datatools.enablement.feature:default"/>
61
<setEntry value="org.eclipse.datatools.enablement.hsqldb.feature.source:default"/>
62
<setEntry value="org.eclipse.datatools.enablement.hsqldb.feature:default"/>
63
<setEntry value="org.eclipse.datatools.enablement.ibm.feature.source:default"/>
64
<setEntry value="org.eclipse.datatools.enablement.ibm.feature:default"/>
65
<setEntry value="org.eclipse.datatools.enablement.ingres.feature.source:default"/>
66
<setEntry value="org.eclipse.datatools.enablement.ingres.feature:default"/>
67
<setEntry value="org.eclipse.datatools.enablement.jdbc.feature.source:default"/>
68
<setEntry value="org.eclipse.datatools.enablement.jdbc.feature:default"/>
69
<setEntry value="org.eclipse.datatools.enablement.jdt.feature.source:default"/>
70
<setEntry value="org.eclipse.datatools.enablement.jdt.feature:default"/>
71
<setEntry value="org.eclipse.datatools.enablement.msft.feature.source:default"/>
72
<setEntry value="org.eclipse.datatools.enablement.msft.feature:default"/>
73
<setEntry value="org.eclipse.datatools.enablement.mysql.feature.source:default"/>
74
<setEntry value="org.eclipse.datatools.enablement.mysql.feature:default"/>
75
<setEntry value="org.eclipse.datatools.enablement.oda.designer.feature.source:default"/>
76
<setEntry value="org.eclipse.datatools.enablement.oda.designer.feature:default"/>
77
<setEntry value="org.eclipse.datatools.enablement.oda.feature.source:default"/>
78
<setEntry value="org.eclipse.datatools.enablement.oda.feature:default"/>
79
<setEntry value="org.eclipse.datatools.enablement.oracle.feature.source:default"/>
80
<setEntry value="org.eclipse.datatools.enablement.oracle.feature:default"/>
81
<setEntry value="org.eclipse.datatools.enablement.postgresql.feature.source:default"/>
82
<setEntry value="org.eclipse.datatools.enablement.postgresql.feature:default"/>
83
<setEntry value="org.eclipse.datatools.enablement.sap.feature.source:default"/>
84
<setEntry value="org.eclipse.datatools.enablement.sap.feature:default"/>
85
<setEntry value="org.eclipse.datatools.enablement.sdk.feature:default"/>
86
<setEntry value="org.eclipse.datatools.enablement.sqlite.feature.source:default"/>
87
<setEntry value="org.eclipse.datatools.enablement.sqlite.feature:default"/>
88
<setEntry value="org.eclipse.datatools.enablement.sybase.feature.source:default"/>
89
<setEntry value="org.eclipse.datatools.enablement.sybase.feature:default"/>
90
<setEntry value="org.eclipse.datatools.intro:default"/>
91
<setEntry value="org.eclipse.datatools.modelbase.feature.source:default"/>
92
<setEntry value="org.eclipse.datatools.modelbase.feature:default"/>
93
<setEntry value="org.eclipse.datatools.sdk.feature:default"/>
94
<setEntry value="org.eclipse.datatools.sqldevtools.data.feature.source:default"/>
95
<setEntry value="org.eclipse.datatools.sqldevtools.data.feature:default"/>
96
<setEntry value="org.eclipse.datatools.sqldevtools.ddl.feature.source:default"/>
97
<setEntry value="org.eclipse.datatools.sqldevtools.ddl.feature:default"/>
98
<setEntry value="org.eclipse.datatools.sqldevtools.ddlgen.feature.source:default"/>
99
<setEntry value="org.eclipse.datatools.sqldevtools.ddlgen.feature:default"/>
100
<setEntry value="org.eclipse.datatools.sqldevtools.feature.source:default"/>
101
<setEntry value="org.eclipse.datatools.sqldevtools.feature:default"/>
102
<setEntry value="org.eclipse.datatools.sqldevtools.parsers.feature.source:default"/>
103
<setEntry value="org.eclipse.datatools.sqldevtools.parsers.feature:default"/>
104
<setEntry value="org.eclipse.datatools.sqldevtools.results.feature.source:default"/>
105
<setEntry value="org.eclipse.datatools.sqldevtools.results.feature:default"/>
106
<setEntry value="org.eclipse.datatools.sqldevtools.schemaobjecteditor.feature:default"/>
107
<setEntry value="org.eclipse.datatools.sqldevtools.sqlbuilder.feature.source:default"/>
108
<setEntry value="org.eclipse.datatools.sqldevtools.sqlbuilder.feature:default"/>
109
<setEntry value="org.eclipse.datatools.sqltools.doc.user:default"/>
110
<setEntry value="org.eclipse.draw2d.sdk:default"/>
111
<setEntry value="org.eclipse.draw2d.source:default"/>
112
<setEntry value="org.eclipse.draw2d:default"/>
113
<setEntry value="org.eclipse.emf.base.source:default"/>
114
<setEntry value="org.eclipse.emf.base:default"/>
115
<setEntry value="org.eclipse.emf.codegen.ecore.source:default"/>
116
<setEntry value="org.eclipse.emf.codegen.ecore.ui.source:default"/>
117
<setEntry value="org.eclipse.emf.codegen.ecore.ui:default"/>
118
<setEntry value="org.eclipse.emf.codegen.ecore:default"/>
119
<setEntry value="org.eclipse.emf.codegen.source:default"/>
120
<setEntry value="org.eclipse.emf.codegen.ui.source:default"/>
121
<setEntry value="org.eclipse.emf.codegen.ui:default"/>
122
<setEntry value="org.eclipse.emf.codegen:default"/>
123
<setEntry value="org.eclipse.emf.common.source:default"/>
124
<setEntry value="org.eclipse.emf.common.ui.source:default"/>
125
<setEntry value="org.eclipse.emf.common.ui:default"/>
126
<setEntry value="org.eclipse.emf.common:default"/>
127
<setEntry value="org.eclipse.emf.converter.source:default"/>
128
<setEntry value="org.eclipse.emf.converter:default"/>
129
<setEntry value="org.eclipse.emf.databinding.edit.source:default"/>
130
<setEntry value="org.eclipse.emf.databinding.edit:default"/>
131
<setEntry value="org.eclipse.emf.databinding.source:default"/>
132
<setEntry value="org.eclipse.emf.databinding:default"/>
133
<setEntry value="org.eclipse.emf.doc.source:default"/>
134
<setEntry value="org.eclipse.emf.doc:default"/>
135
<setEntry value="org.eclipse.emf.ecore.edit.source:default"/>
136
<setEntry value="org.eclipse.emf.ecore.edit:default"/>
137
<setEntry value="org.eclipse.emf.ecore.editor.source:default"/>
138
<setEntry value="org.eclipse.emf.ecore.editor:default"/>
139
<setEntry value="org.eclipse.emf.ecore.source:default"/>
140
<setEntry value="org.eclipse.emf.ecore:default"/>
141
<setEntry value="org.eclipse.emf.edit.source:default"/>
142
<setEntry value="org.eclipse.emf.edit.ui.source:default"/>
143
<setEntry value="org.eclipse.emf.edit.ui:default"/>
144
<setEntry value="org.eclipse.emf.edit:default"/>
145
<setEntry value="org.eclipse.emf.mapping.ecore.editor.source:default"/>
146
<setEntry value="org.eclipse.emf.mapping.ecore.editor:default"/>
147
<setEntry value="org.eclipse.emf.mapping.ecore.source:default"/>
148
<setEntry value="org.eclipse.emf.mapping.ecore:default"/>
149
<setEntry value="org.eclipse.emf.mapping.source:default"/>
150
<setEntry value="org.eclipse.emf.mapping.ui.source:default"/>
151
<setEntry value="org.eclipse.emf.mapping.ui:default"/>
152
<setEntry value="org.eclipse.emf.mapping:default"/>
153
<setEntry value="org.eclipse.emf.sdk:default"/>
154
<setEntry value="org.eclipse.emf.source:default"/>
155
<setEntry value="org.eclipse.emf:default"/>
156
<setEntry value="org.eclipse.equinox.p2.user.ui.source:default"/>
157
<setEntry value="org.eclipse.equinox.p2.user.ui:default"/>
158
<setEntry value="org.eclipse.gef.sdk:default"/>
159
<setEntry value="org.eclipse.gef.source:default"/>
160
<setEntry value="org.eclipse.gef:default"/>
161
<setEntry value="org.eclipse.help.source:default"/>
162
<setEntry value="org.eclipse.help:default"/>
163
<setEntry value="org.eclipse.jdt.source:default"/>
164
<setEntry value="org.eclipse.jdt:default"/>
165
<setEntry value="org.eclipse.jpt.eclipselink.feature.source:default"/>
166
<setEntry value="org.eclipse.jpt.eclipselink.feature:default"/>
167
<setEntry value="org.eclipse.jpt.eclipselink_sdk.feature:default"/>
168
<setEntry value="org.eclipse.jpt.feature.source:default"/>
169
<setEntry value="org.eclipse.jpt.feature:default"/>
170
<setEntry value="org.eclipse.jpt.jaxb.eclipselink.feature.source:default"/>
171
<setEntry value="org.eclipse.jpt.jaxb.eclipselink.feature:default"/>
172
<setEntry value="org.eclipse.jpt.jaxb.eclipselink_sdk.feature:default"/>
173
<setEntry value="org.eclipse.jpt.jaxb.feature.source:default"/>
174
<setEntry value="org.eclipse.jpt.jaxb.feature:default"/>
175
<setEntry value="org.eclipse.jpt.jaxb.tests.feature:default"/>
176
<setEntry value="org.eclipse.jpt.jaxb_sdk.feature:default"/>
177
<setEntry value="org.eclipse.jpt.sdk:default"/>
178
<setEntry value="org.eclipse.jpt.tests.feature:default"/>
179
<setEntry value="org.eclipse.jpt.tests:default"/>
180
<setEntry value="org.eclipse.jpt_sdk.feature:default"/>
181
<setEntry value="org.eclipse.jsf.feature.source:default"/>
182
<setEntry value="org.eclipse.jsf.feature:default"/>
183
<setEntry value="org.eclipse.jsf_sdk.feature:default"/>
184
<setEntry value="org.eclipse.jst.common.fproj.enablement.jdt.sdk:default"/>
185
<setEntry value="org.eclipse.jst.common.fproj.enablement.jdt:default"/>
186
<setEntry value="org.eclipse.jst.enterprise_core.feature.source:default"/>
187
<setEntry value="org.eclipse.jst.enterprise_core.feature:default"/>
188
<setEntry value="org.eclipse.jst.enterprise_sdk.feature:default"/>
189
<setEntry value="org.eclipse.jst.enterprise_ui.feature.source:default"/>
190
<setEntry value="org.eclipse.jst.enterprise_ui.feature:default"/>
191
<setEntry value="org.eclipse.jst.enterprise_userdoc.feature:default"/>
192
<setEntry value="org.eclipse.jst.jsf.apache.trinidad.tagsupport.feature.source:default"/>
193
<setEntry value="org.eclipse.jst.jsf.apache.trinidad.tagsupport.feature:default"/>
194
<setEntry value="org.eclipse.jst.jsf.apache.trinidad.tagsupport_sdk.feature:default"/>
195
<setEntry value="org.eclipse.jst.server_adapters.ext.feature.source:default"/>
196
<setEntry value="org.eclipse.jst.server_adapters.ext.feature:default"/>
197
<setEntry value="org.eclipse.jst.server_adapters.ext.sdk.feature:default"/>
198
<setEntry value="org.eclipse.jst.server_adapters.feature.source:default"/>
199
<setEntry value="org.eclipse.jst.server_adapters.feature:default"/>
200
<setEntry value="org.eclipse.jst.server_adapters.sdk.feature:default"/>
201
<setEntry value="org.eclipse.jst.server_core.feature.source:default"/>
202
<setEntry value="org.eclipse.jst.server_core.feature:default"/>
203
<setEntry value="org.eclipse.jst.server_sdk.feature:default"/>
204
<setEntry value="org.eclipse.jst.server_ui.feature.source:default"/>
205
<setEntry value="org.eclipse.jst.server_ui.feature:default"/>
206
<setEntry value="org.eclipse.jst.server_userdoc.feature:default"/>
207
<setEntry value="org.eclipse.jst.web_core.feature.source:default"/>
208
<setEntry value="org.eclipse.jst.web_core.feature:default"/>
209
<setEntry value="org.eclipse.jst.web_sdk.feature:default"/>
210
<setEntry value="org.eclipse.jst.web_ui.feature.source:default"/>
211
<setEntry value="org.eclipse.jst.web_ui.feature:default"/>
212
<setEntry value="org.eclipse.jst.web_userdoc.feature:default"/>
213
<setEntry value="org.eclipse.jst.webpageeditor.feature.source:default"/>
214
<setEntry value="org.eclipse.jst.webpageeditor.feature:default"/>
215
<setEntry value="org.eclipse.jst.webpageeditor_sdk.feature:default"/>
216
<setEntry value="org.eclipse.jst.ws.axis2tools.feature.source:default"/>
217
<setEntry value="org.eclipse.jst.ws.axis2tools.feature:default"/>
218
<setEntry value="org.eclipse.jst.ws.axis2tools_sdk.feature:default"/>
219
<setEntry value="org.eclipse.jst.ws.cxf.feature.source:default"/>
220
<setEntry value="org.eclipse.jst.ws.cxf.feature:default"/>
221
<setEntry value="org.eclipse.jst.ws.cxf_sdk.feature:default"/>
222
<setEntry value="org.eclipse.jst.ws.jaxws.dom.feature.source:default"/>
223
<setEntry value="org.eclipse.jst.ws.jaxws.dom.feature:default"/>
224
<setEntry value="org.eclipse.jst.ws.jaxws.dom_sdk.feature:default"/>
225
<setEntry value="org.eclipse.jst.ws.jaxws.feature.source:default"/>
226
<setEntry value="org.eclipse.jst.ws.jaxws.feature:default"/>
227
<setEntry value="org.eclipse.jst.ws.jaxws_sdk.feature:default"/>
228
<setEntry value="org.eclipse.jst.ws.jaxws_userdoc.feature:default"/>
229
<setEntry value="org.eclipse.pde.source:default"/>
230
<setEntry value="org.eclipse.pde:default"/>
231
<setEntry value="org.eclipse.platform.source:default"/>
232
<setEntry value="org.eclipse.platform:default"/>
233
<setEntry value="org.eclipse.rcp.source:default"/>
234
<setEntry value="org.eclipse.rcp:default"/>
235
<setEntry value="org.eclipse.sdk:default"/>
236
<setEntry value="org.eclipse.wst.common.fproj.sdk:default"/>
237
<setEntry value="org.eclipse.wst.common.fproj:default"/>
238
<setEntry value="org.eclipse.wst.common_core.feature.source:default"/>
239
<setEntry value="org.eclipse.wst.common_core.feature:default"/>
240
<setEntry value="org.eclipse.wst.common_sdk.feature:default"/>
241
<setEntry value="org.eclipse.wst.common_ui.feature.source:default"/>
242
<setEntry value="org.eclipse.wst.common_ui.feature:default"/>
243
<setEntry value="org.eclipse.wst.jsdt.feature.source:default"/>
244
<setEntry value="org.eclipse.wst.jsdt.feature:default"/>
245
<setEntry value="org.eclipse.wst.jsdt_sdk.feature:default"/>
246
<setEntry value="org.eclipse.wst.server_adapters.feature.source:default"/>
247
<setEntry value="org.eclipse.wst.server_adapters.feature:default"/>
248
<setEntry value="org.eclipse.wst.server_adapters.sdk.feature:default"/>
249
<setEntry value="org.eclipse.wst.server_core.feature.source:default"/>
250
<setEntry value="org.eclipse.wst.server_core.feature:default"/>
251
<setEntry value="org.eclipse.wst.server_sdk.feature:default"/>
252
<setEntry value="org.eclipse.wst.server_ui.feature.source:default"/>
253
<setEntry value="org.eclipse.wst.server_ui.feature:default"/>
254
<setEntry value="org.eclipse.wst.server_userdoc.feature:default"/>
255
<setEntry value="org.eclipse.wst.web_core.feature.source:default"/>
256
<setEntry value="org.eclipse.wst.web_core.feature:default"/>
257
<setEntry value="org.eclipse.wst.web_sdk.feature:default"/>
258
<setEntry value="org.eclipse.wst.web_ui.feature.source:default"/>
259
<setEntry value="org.eclipse.wst.web_ui.feature:default"/>
260
<setEntry value="org.eclipse.wst.web_userdoc.feature:default"/>
261
<setEntry value="org.eclipse.wst.ws_core.feature.source:default"/>
262
<setEntry value="org.eclipse.wst.ws_core.feature:default"/>
263
<setEntry value="org.eclipse.wst.ws_sdk.feature:default"/>
264
<setEntry value="org.eclipse.wst.ws_ui.feature.source:default"/>
265
<setEntry value="org.eclipse.wst.ws_ui.feature:default"/>
266
<setEntry value="org.eclipse.wst.ws_userdoc.feature:default"/>
267
<setEntry value="org.eclipse.wst.ws_wsdl15.feature:default"/>
268
<setEntry value="org.eclipse.wst.xml.security.feature.source:default"/>
269
<setEntry value="org.eclipse.wst.xml.security.feature:default"/>
270
<setEntry value="org.eclipse.wst.xml.security_sdk.feature:default"/>
271
<setEntry value="org.eclipse.wst.xml.xpath2.processor.feature:default"/>
272
<setEntry value="org.eclipse.wst.xml_core.feature.source:default"/>
273
<setEntry value="org.eclipse.wst.xml_core.feature:default"/>
274
<setEntry value="org.eclipse.wst.xml_sdk.feature:default"/>
275
<setEntry value="org.eclipse.wst.xml_ui.feature.source:default"/>
276
<setEntry value="org.eclipse.wst.xml_ui.feature:default"/>
277
<setEntry value="org.eclipse.wst.xml_userdoc.feature:default"/>
278
<setEntry value="org.eclipse.wst.xsl.feature.source:default"/>
279
<setEntry value="org.eclipse.wst.xsl.feature:default"/>
280
<setEntry value="org.eclipse.wst.xsl_sdk.feature:default"/>
281
<setEntry value="org.eclipse.xsd.doc.source:default"/>
282
<setEntry value="org.eclipse.xsd.doc:default"/>
283
<setEntry value="org.eclipse.xsd.ecore.converter.source:default"/>
284
<setEntry value="org.eclipse.xsd.ecore.converter:default"/>
285
<setEntry value="org.eclipse.xsd.edit.source:default"/>
286
<setEntry value="org.eclipse.xsd.edit:default"/>
287
<setEntry value="org.eclipse.xsd.editor.source:default"/>
288
<setEntry value="org.eclipse.xsd.editor:default"/>
289
<setEntry value="org.eclipse.xsd.mapping.editor.source:default"/>
290
<setEntry value="org.eclipse.xsd.mapping.editor:default"/>
291
<setEntry value="org.eclipse.xsd.mapping.source:default"/>
292
<setEntry value="org.eclipse.xsd.mapping:default"/>
293
<setEntry value="org.eclipse.xsd.sdk:default"/>
294
<setEntry value="org.eclipse.xsd.source:default"/>
295
<setEntry value="org.eclipse.xsd:default"/>
296
<setEntry value="org.tigris.subversion.clientadapter.feature:default"/>
297
<setEntry value="org.tigris.subversion.clientadapter.javahl.feature:default"/>
298
<setEntry value="org.tigris.subversion.clientadapter.svnkit.feature:default"/>
299
<setEntry value="org.tigris.subversion.subclipse.graph.feature:default"/>
300
<setEntry value="org.tigris.subversion.subclipse.mylyn:default"/>
301
<setEntry value="org.tigris.subversion.subclipse:default"/>
302
<setEntry value="org.tmatesoft.svnkit:default"/>
303
</setAttribute>
304
<stringAttribute key="selected_target_plugins" value="org.eclipse.ecf.provider.filetransfer.httpclient@default:default,org.eclipse.jpt.core@default:default,org.eclipse.wst.web.ui@default:default,org.eclipse.datatools.enablement.mysql.dbdefinition@default:default,org.eclipse.wst.xsl@default:default,org.eclipse.wst.css.ui@default:default,org.apache.commons.logging@default:default,org.eclipse.emf.databinding.edit@default:default,org.eclipse.jst.ws.creation.ui@default:default,org.eclipse.equinox.p2.touchpoint.natives@default:default,org.eclipse.jst.jsf.doc.user@default:default,org.eclipse.emf.codegen.ecore.ui@default:default,org.eclipse.gef.doc.isv@default:default,org.eclipse.equinox.concurrent@default:default,org.eclipse.help.webapp@default:default,org.eclipse.jst.j2ee.ejb.annotations.xdoclet@default:default,org.eclipse.wst.xml.ui.infopop@default:default,org.eclipse.wst.ws.parser@default:default,com.jcraft.jsch@default:default,org.eclipse.wst.common.infopop@default:default,org.eclipse.xsd.doc@default:default,org.eclipse.jst.ws.cxf.doc.user@default:default,org.eclipse.datatools.enablement.mysql.ui@default:default,org.eclipse.datatools.enablement.ibm.db2.zseries@default:default,org.eclipse.debug.ui@default:default,org.eclipse.wst.command.env.ui@default:default,org.eclipse.equinox.p2.ui.sdk.scheduler@default:default,org.eclipse.jst.pagedesigner@default:default,org.eclipse.wst.dtdeditor.doc.user@default:default,org.eclipse.jst.jsf.facelet.core@default:default,org.mozilla.javascript@default:default,org.eclipse.jst.ws.cxf.ui@default:default,org.eclipse.jst.ws.consumption@default:default,org.eclipse.jdt.debug.ui@default:default,org.eclipse.jst.j2ee.ui@default:default,org.eclipse.wst.sse.ui@default:default,org.eclipse.wst.server.core@default:default,org.eclipse.jst.ws.jaxws.doc.user@default:default,org.eclipse.core.filesystem.win32.x86_64@default:false,org.eclipse.datatools.sqltools.db.generic@default:default,org.eclipse.equinox.p2.director@default:default,org.eclipse.jst.j2ee.ejb.annotation.model@default:default,org.eclipse.datatools.connectivity.apache.derby.ui@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.equinox.http.registry@default:default,org.sat4j.core@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.datatools.enablement.oda.xml@default:default,org.eclipse.jst.j2ee.jca.ui@default:default,org.apache.ant@default:default,org.eclipse.jpt.jaxb.eclipselink.branding@default:default,org.eclipse.wst.common.uriresolver@default:default,org.eclipse.jst.j2ee.webservice@default:default,org.eclipse.datatools.connectivity.oda@default:default,org.eclipse.wst.server.http.ui@default:default,org.eclipse.core.jobs@default:default,org.eclipse.jst.jsf.ui@default:default,org.eclipse.update.configurator@3:true,org.eclipse.datatools.modelbase.sql.xml.query@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.emf.common.ui@default:default,org.eclipse.ecf.provider.filetransfer.httpclient.ssl@default:false,org.eclipse.jst.ws.ui@default:default,org.eclipse.jst.common.frameworks@default:default,org.eclipse.datatools.enablement.sybase.ase@default:default,org.eclipse.datatools.enablement.hsqldb.ui@default:default,org.eclipse.wst.jsdt.core@default:default,org.eclipse.pde.ds.ui@default:default,org.eclipse.jst.ws.cxf.creation.core@default:default,org.eclipse.jst.jsp.ui@default:default,org.eclipse.osgi.services@default:default,org.eclipse.equinox.p2.director.app@default:default,org.eclipse.xsd.editor@default:default,org.eclipse.datatools.sqltools.debugger.core.ui@default:default,org.eclipse.xsd.ecore.converter@default:default,org.eclipse.emf.converter@default:default,org.eclipse.cvs@default:default,org.eclipse.pde.ui.templates@default:default,org.eclipse.datatools.connectivity.doc.user.contexts@default:default,org.eclipse.wst.doc.user@default:default,org.eclipse.team.cvs.core@default:default,org.eclipse.datatools.enablement.msft.sqlserver.ui@default:default,org.eclipse.wst.ws.explorer@default:default,org.eclipse.emf.ecore.edit@default:default,org.eclipse.wst.common.frameworks.ui@default:default,org.eclipse.datatools.sqltools.parsers.sql@default:default,org.eclipse.jst.ws.jaxws.ui@default:default,org.eclipse.jst.server.ui.infopop@default:default,org.eclipse.jst.server.ui@default:default,org.eclipse.search@default:default,org.eclipse.swt@default:default,org.eclipse.wst.internet.monitor.core@default:default,org.eclipse.datatools.sdk@default:default,org.eclipse.debug.core@default:default,org.eclipse.datatools.enablement.mysql@default:default,org.eclipse.datatools.enablement.sybase.ui@default:default,org.eclipse.ui.forms@default:default,org.eclipse.jst.ejb.ui.infopop@default:default,org.eclipse.wst.jsdt.debug.rhino.ui@default:default,org.eclipse.datatools.sqltools.routineeditor@default:default,org.junit*3.8.2.v3_8_2_v20100427-1100@default:default,org.sat4j.pb@default:default,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.jpt.db.ui@default:default,org.eclipse.jpt.eclipselink.core.ddlgen@default:default,org.eclipse.ui.presentations.r21@default:default,org.eclipse.jst.ws.jaxrs.ui@default:default,org.eclipse.jpt.jaxb.eclipselink.core.schemagen@default:default,org.eclipse.datatools.enablement.ibm.db2.iseries.dbdefinition@default:default,org.eclipse.equinox.p2.metadata.generator@default:default,org.eclipse.wst.jsdt.manipulation@default:default,org.eclipse.datatools.enablement.finfo@default:default,org.eclipse.ltk.core.refactoring@default:default,org.eclipse.jst.ws.cxf.consumption.ui@default:default,org.eclipse.ui.navigator@default:default,org.eclipse.datatools.connectivity.sqm.core.ui@default:default,org.eclipse.jst.j2ee.web@default:default,org.eclipse.jem.util@default:default,org.eclipse.datatools.enablement.sap.maxdb.dbdefinition@default:default,org.eclipse.wst.internet.monitor.ui@default:default,org.eclipse.jst.common.fproj.enablement.jdt.sdk@default:default,org.eclipse.datatools.sqltools.schemaobjecteditor@default:default,org.eclipse.datatools.sqltools.schemaobjecteditor.ui@default:default,org.eclipse.wst.xsl.sdk.documentation@default:default,org.eclipse.datatools.enablement.sybase.asa.models@default:default,org.eclipse.equinox.launcher@default:default,org.eclipse.pde.api.tools@default:default,org.eclipse.pde.ua.ui@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.jst.jsf.facesconfig.ui@default:default,org.eclipse.datatools.enablement.sqlite.dbdefinition@default:default,org.eclipse.jpt.jaxb.ui@default:default,org.eclipse.wst.jsdt.web.ui@default:default,org.eclipse.jst.j2ee.ejb.annotations.ui@default:default,org.eclipse.datatools.connectivity.sqm.server.ui@default:default,org.eclipse.jdt.ui@default:default,javax.xml.bind@default:default,org.eclipse.wst.xsdeditor.doc.user@default:default,org.eclipse.wst.xmleditor.doc.user@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.jface.text@default:default,org.eclipse.jdt.apt.core@default:default,org.eclipse.wst.xsl.exslt.core@default:default,org.eclipse.jst.ws.jaxrs.core@default:default,org.eclipse.jst.jsf.common.runtime@default:default,org.apache.xml.resolver@default:default,org.eclipse.wst.wsi@default:default,org.eclipse.jpt.jaxb.core.schemagen@default:default,org.eclipse.wst.xsl.doc@default:default,org.eclipse.wst.jsdt.ui@default:default,org.apache.jasper@default:default,org.eclipse.equinox.common@2:true,org.eclipse.wst.validation@default:default,org.eclipse.wst.command.env.infopop@default:default,org.eclipse.datatools.connectivity.sqm.core@default:default,org.eclipse.ui.workbench.compatibility@default:false,org.eclipse.datatools.doc.isv@default:default,org.eclipse.equinox.launcher.win32.win32.x86_64@default:false,org.eclipse.jdt.launching@default:default,org.eclipse.wst.xml.xpath2.processor@default:default,org.eclipse.equinox.p2.operations@default:default,org.eclipse.datatools.enablement.sybase.asa@default:default,org.eclipse.osgi@-1:true,org.eclipse.datatools.doc.user@default:default,org.eclipse.ui.ide@default:default,org.eclipse.datatools.enablement.sybase.ase.models@default:default,org.eclipse.datatools.connectivity.console.profile@default:default,org.eclipse.jem.beaninfo.vm.common@default:default,org.eclipse.jst.ws.jaxws.utils@default:default,org.eclipse.ant.optional.junit@default:false,org.eclipse.team.cvs.ui@default:default,org.eclipse.datatools.sqltools.data.core@default:default,org.eclipse.datatools.enablement.ibm.ui@default:default,org.eclipse.xsd.mapping.editor@default:default,org.eclipse.wst.server.ui.doc.user@default:default,org.eclipse.core.commands@default:default,org.eclipse.datatools.modelbase.dbdefinition@default:default,org.eclipse.wst.xsl.xalan@default:default,org.eclipse.wst.server.discovery@default:default,org.eclipse.pde@default:default,org.eclipse.jst.ws.axis2.core@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.datatools.enablement.ingres.dbdefinition@default:default,org.eclipse.wst.xsl.jaxp.debug@default:default,org.apache.wsil4j@default:default,org.eclipse.compare.core@default:default,org.eclipse.wst.ws.infopop@default:default,org.eclipse.jst.j2ee.infopop@default:default,javax.xml.stream@default:default,org.eclipse.equinox.p2.repository.tools@default:default,org.eclipse.jst.ws.jaxws.core@default:default,org.apache.commons.el@default:default,org.eclipse.jst.j2ee@default:default,org.eclipse.wst.xsl.exslt.ui@default:default,org.eclipse.jst.common.annotations.controller@default:default,org.eclipse.datatools.sqltools.doc.user.contexts@default:default,org.eclipse.jst.server.tomcat.core@default:default,org.eclipse.equinox.p2.reconciler.dropins@default:default,org.eclipse.jst.jsf.common@default:default,org.eclipse.datatools.connectivity.ui.dse@default:default,org.eclipse.wst.sse.doc.user@default:default,org.eclipse.datatools.connectivity.apache.derby.dbdefinition@default:default,org.eclipse.emf.ecore.editor@default:default,org.eclipse.wst.command.env@default:default,org.eclipse.draw2d.doc.isv@default:default,org.eclipse.wst.common.snippets@default:default,org.eclipse.core.boot@default:default,org.eclipse.core.net.win32.x86_64@default:false,org.eclipse.jem.workbench@default:default,org.eclipse.core.filesystem@default:default,org.eclipse.update.core.win32@default:false,org.eclipse.jpt.utility@default:default,org.eclipse.datatools.enablement.ibm.db2.iseries@default:default,org.eclipse.wst.jsdt.debug.rhino.debugger@default:default,org.eclipse.datatools.connectivity.doc.user@default:default,org.eclipse.jst.j2ee.ejb.annotations.emitter@default:default,org.eclipse.datatools.sqltools.editor.core.ui@default:default,org.eclipse.jst.server.core@default:default,org.eclipse.equinox.p2.publisher@default:default,org.eclipse.equinox.p2.ui@default:default,org.eclipse.wst.common.project.facet.ui@default:default,org.eclipse.datatools.connectivity@default:default,org.eclipse.wst.xsl.saxon@default:default,org.eclipse.update.ui@default:default,org.eclipse.equinox.frameworkadmin.equinox@default:default,org.eclipse.wst.common.ui@default:default,org.eclipse.datatools.enablement.postgresql.ui@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.jst.common.project.facet.core@default:default,org.eclipse.equinox.p2.garbagecollector@default:default,org.eclipse.datatools.enablement.sap.maxdb@default:default,org.eclipse.equinox.simpleconfigurator.manipulator@default:default,org.eclipse.jst.common.annotations.ui@default:default,javax.jws@default:default,org.eclipse.wst.validation.infopop@default:default,org.eclipse.gef@default:default,org.eclipse.ui.views.log@default:default,org.eclipse.pde.ua.core@default:default,org.eclipse.datatools.enablement.ibm.informix.dbdefinition@default:default,org.eclipse.core.expressions@default:default,org.eclipse.jst.server.generic.jboss@default:default,org.eclipse.jpt.ui@default:default,org.apache.commons.discovery@default:default,javax.xml.rpc@default:default,org.eclipse.datatools.sqltools.editor.core@default:default,org.eclipse.equinox.p2.ui.sdk@default:default,org.eclipse.team.core@default:default,org.eclipse.datatools.sqltools.routineeditor.ui@default:default,org.eclipse.jst.server.tomcat.ui@default:default,org.eclipse.equinox.security@default:default,org.eclipse.jst.j2ee.webservice.ui@default:default,org.eclipse.wst.ws.api.doc@default:default,org.eclipse.datatools.sqltools.db.generic.ui@default:default,org.eclipse.wst.ws.ui@default:default,org.eclipse.jst.ws.cxf.core@default:default,org.eclipse.wst.internet.cache@default:default,org.eclipse.equinox.p2.console@default:default,org.eclipse.wst.dtd.ui@default:default,org.apache.xalan@default:default,org.eclipse.datatools.enablement.ibm.informix@default:default,org.eclipse.wst.server.http.core@default:default,org.eclipse.wst.validation.ui@default:default,org.eclipse.ui.views@default:default,org.eclipse.ui@default:default,org.eclipse.emf.ant@default:default,org.eclipse.jst.ws.axis.consumption.core@default:default,org.eclipse.datatools.enablement.ingres.ui@default:default,org.eclipse.update.core@default:default,javax.mail@default:default,org.apache.bcel@default:default,javax.wsdl*1.5.1.v201012040544@default:default,org.eclipse.wst.common.modulecore.ui@default:default,org.eclipse.core.databinding.beans@default:default,org.eclipse.jdt@default:default,org.eclipse.wst.xsl.jaxp.launching@default:default,org.eclipse.wst.web.ui.infopop@default:default,org.eclipse.wst.dtd.ui.infopop@default:default,org.eclipse.datatools.enablement.msft.sqlserver@default:default,org.eclipse.emf.common@default:default,org.eclipse.equinox.security.ui@default:default,org.eclipse.wst.xsl.launching@default:default,org.eclipse.wst.common.environment@default:default,org.eclipse.datatools.enablement.sybase.asa.ui@default:default,org.eclipse.ant.core@default:default,org.eclipse.ecf@default:default,org.eclipse.jst.server.generic.oc4j@default:default,org.apache.commons.lang@default:default,org.eclipse.ui.ide.application@default:default,org.eclipse.datatools.enablement.ibm.db2.zseries.ui@default:default,org.eclipse.wst.wsdl.ui.doc.user@default:default,org.eclipse.jst.jsf.core@default:default,org.eclipse.core.resources@default:default,org.eclipse.jsf.branding@default:default,org.eclipse.jst.common.project.facet.ui@default:default,org.eclipse.jdt.core.manipulation@default:default,org.eclipse.jst.ws.jaxws.dom.integration@default:default,org.eclipse.datatools.enablement.sybase.models@default:default,org.eclipse.datatools.sqltools.schemaobjecteditor.ui.pages@default:default,org.eclipse.wst.xsl.jaxp.debug.ui@default:default,org.eclipse.wst.xsl.ui@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.datatools.sqltools.sqlscrapbook@default:default,org.eclipse.datatools.connectivity.ui@default:default,org.eclipse.datatools.sqltools.plan@default:default,org.eclipse.datatools.modelbase.sql.edit@default:default,org.eclipse.datatools.enablement.sqlite.ui@default:default,org.eclipse.jst.j2ee.jca@default:default,net.sourceforge.lpg.lpgjavaruntime@default:default,org.eclipse.wst.html.core@default:default,org.eclipse.ui.navigator.resources@default:default,org.eclipse.pde.doc.user@default:default,org.apache.lucene@default:default,org.eclipse.update.scheduler@default:default,org.eclipse.datatools.sqltools.doc.user@default:default,org.eclipse.ui.win32@default:false,org.eclipse.datatools.connectivity.db.generic@default:default,org.uddi4j@default:default,org.eclipse.wst.html.ui@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.emf.importer.java@default:default,org.eclipse.jst.j2ee.ejb@default:default,org.eclipse.datatools.enablement.ibm.db2.luw@default:default,org.eclipse.jst.ws.axis2.consumption.ui@default:default,org.eclipse.equinox.http.jetty@default:default,org.mortbay.jetty.util@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.jst.ws@default:default,org.eclipse.platform.doc.user@default:default,org.eclipse.jst.ws.consumption.ui.doc.user@default:default,org.eclipse.jdt.debug@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.jpt.doc.isv@default:default,org.eclipse.datatools.sqltools.parsers.sql.lexer@default:default,org.eclipse.jface@default:default,org.eclipse.core.net@default:default,org.eclipse.pde.runtime@default:default,org.eclipse.jst.ws.uddiregistry@default:default,org.eclipse.jst.ws.annotations.core@default:default,org.eclipse.datatools.enablement.sap.maxdb.ui@default:default,org.apache.xml.serializer@default:default,org.eclipse.emf.doc@default:default,org.eclipse.wst.server.preview@default:default,org.eclipse.datatools.enablement.oracle@default:default,javax.xml@default:default,org.eclipse.datatools.connectivity.ui.templates@default:default,org.eclipse.jdt.junit.core@default:default,org.eclipse.datatools.sqltools.db.derby@default:default,org.eclipse.ui.intro.universal@default:default,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.datatools.enablement.sybase.asa.schemaobjecteditor.examples@default:default,org.eclipse.datatools.oda.cshelp@default:default,org.eclipse.wst.server.ui.infopop@default:default,org.eclipse.pde.launching@default:default,org.eclipse.wst.jsdt.support.ie@default:default,org.eclipse.datatools.sqltools.db.derby.ui@default:default,org.eclipse.datatools.enablement.ingres@default:default,org.eclipse.jdt.compiler.apt@default:false,org.eclipse.jpt.eclipselink.ui@default:default,org.eclipse.ui.console@default:default,org.eclipse.jpt.doc.user@default:default,org.eclipse.wst.common.emf@default:default,org.eclipse.datatools.connectivity.dbdefinition.genericJDBC@default:default,org.eclipse.ui.intro@default:default,org.eclipse.text@default:default,org.eclipse.datatools.enablement.jdt.classpath@default:default,org.eclipse.jsch.core@default:default,org.eclipse.datatools.enablement.sybase.ase.ui@default:default,org.eclipse.jsch.ui@default:default,org.eclipse.datatools.enablement.oda.ws.ui@default:default,org.eclipse.wst.jsdt.web.support.jsp@default:default,org.eclipse.jst.ws.axis.consumption.ui@default:default,org.eclipse.pde.ds.core@default:default,org.eclipse.emf.importer@default:default,org.eclipse.jst.server.generic.core@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.equinox.p2.artifact.repository@default:default,org.eclipse.datatools.enablement.postgresql.dbdefinition@default:default,org.eclipse.test@default:default,org.eclipse.jst.ws.axis2.ui.doc.user@default:default,org.eclipse.datatools.enablement.sqlite@default:default,org.eclipse.datatools.sqltools.result@default:default,org.eclipse.ltk.ui.refactoring@default:default,org.eclipse.equinox.frameworkadmin@default:default,org.eclipse.jst.ws.infopop@default:default,org.eclipse.jst.jee.ui@default:default,org.eclipse.wst.sse.core@default:default,org.eclipse.jst.ws.axis2.creation.core@default:default,org.eclipse.wst.common.emfworkbench.integration@default:default,org.eclipse.emf.mapping.ecore2xml@default:default,org.eclipse.jst.jsf.facesconfig@default:default,org.eclipse.wst.html.ui.infopop@default:default,org.eclipse.jst.ws.cxf.consumption.core@default:default,org.eclipse.datatools.connectivity.oda.flatfile@default:default,org.eclipse.jst.ws.doc.user@default:default,org.eclipse.jst.jsf.common.ui@default:default,org.apache.lucene.analysis@default:default,org.eclipse.jpt.jaxb.core@default:default,org.eclipse.team.ui@default:default,org.eclipse.datatools.connectivity.db.generic.ui@default:default,org.eclipse.emf.edit.ui@default:default,org.eclipse.pde.junit.runtime@default:default,org.eclipse.wst.jsdt.debug.core@default:default,org.eclipse.ui.views.properties.tabbed@default:default,org.eclipse.wst.jsdt.doc@default:default,org.eclipse.draw2d@default:default,org.eclipse.jdt.apt.pluggable.core@default:default,org.eclipse.datatools.enablement.sybase.asa.dbdefinition@default:default,org.eclipse.jst.ws.jaxws.dom.runtime@default:default,org.eclipse.wst.xsl.debug.ui@default:default,org.eclipse.jst.ws.axis2.creation.ui@default:default,org.eclipse.jem.beaninfo.vm@default:default,org.apache.commons.collections@default:default,org.eclipse.equinox.p2.extensionlocation@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.wst.standard.schemas@default:default,org.eclipse.equinox.simpleconfigurator@1:true,org.eclipse.wst.wsdl.doc.isv@default:default,org.eclipse.wst.xml.xpath2.processor.doc.user@default:default,org.eclipse.datatools.modelbase.sql.query.edit@default:default,org.eclipse.core.runtime@default:true,org.eclipse.jst.server.preview.adapter@default:default,javax.servlet@default:default,org.eclipse.jst.server.websphere.core@default:default,org.eclipse.jst.ejb.doc.user@default:default,org.eclipse.datatools.connectivity.apache.derby@default:default,org.eclipse.emf.codegen.ecore@default:default,org.eclipse.jst.ejb.ui@default:default,org.eclipse.datatools.enablement.oda.xml.ui@default:default,org.eclipse.jst.jsf.apache.trinidad.tagsupport@default:default,org.eclipse.equinox.p2.jarprocessor@default:default,org.eclipse.wst.server.ui@default:default,org.eclipse.jpt.branding@default:default,org.eclipse.wst.wsdl.ui@default:default,org.eclipse.datatools.sqltools.sqleditor@default:default,org.eclipse.equinox.app@default:default,org.eclipse.wst.ws@default:default,org.eclipse.emf.exporter@default:default,org.eclipse.ui.externaltools@default:default,org.eclipse.wst.common.api.doc@default:default,org.eclipse.jst.servlet.ui.infopop@default:default,org.eclipse.datatools.connectivity.oda.design@default:default,org.eclipse.wst.common.project.facet.core@default:default,org.eclipse.jst.jsf.facelet.ui@default:default,javax.wsdl*1.6.2.v201012040545@default:default,org.junit4@default:default,org.eclipse.xsd.ecore.exporter@default:default,org.eclipse.jst.j2ee.navigator.ui@default:default,org.eclipse.datatools.enablement.ibm.db2.zseries.dbdefinition@default:default,org.eclipse.core.externaltools@default:default,org.eclipse.jst.ws.consumption.ui@default:default,org.eclipse.jdt.junit4.runtime@default:default,org.eclipse.gef.examples.ui.pde@default:default,org.eclipse.emf.mapping.xsd2ecore@default:default,org.eclipse.datatools.sqltools.debugger.core@default:default,org.eclipse.jdt.compiler.tool@default:false,org.eclipse.datatools.enablement.ibm.db2.luw.ui@default:default,org.eclipse.datatools.enablement.hsqldb.dbdefinition@default:default,org.eclipse.emf.cheatsheets@default:default,org.eclipse.jdt.junit@default:default,org.eclipse.emf.edit@default:default,org.eclipse.emf.mapping.ecore2xml.ui@default:default,org.eclipse.emf.mapping.ecore.editor@default:default,org.eclipse.help.ui@default:default,org.eclipse.emf.codegen@default:default,org.eclipse.datatools.enablement.oracle.ui@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.wst.jsdt.debug.rhino@default:default,org.hamcrest.core@default:default,org.eclipse.pde.core@default:default,org.apache.oro@default:default,org.eclipse.datatools.enablement.msft.sqlserver.dbdefinition@default:default,org.eclipse.ui.cheatsheets@default:default,org.apache.axis@default:default,org.eclipse.wst.common.project.facet.doc.api@default:default,org.eclipse.wst.common.fproj.sdk@default:default,org.eclipse.wst.xsd.core@default:default,org.eclipse.pde.api.tools.ui@default:default,org.eclipse.datatools.connectivity.oda.flatfile.ui@default:default,org.eclipse.jst.jee.ejb@default:default,org.eclipse.wst.xsd.ui@default:default,org.eclipse.pde.ui@default:default,org.eclipse.jst.jsp.ui.infopop@default:default,org.apache.commons.codec@default:default,org.eclipse.jdt.junit.runtime@default:default,org.eclipse.xsd.mapping@default:default,org.eclipse.xsd.edit@default:default,org.apache.lucene.core@default:default,org.eclipse.datatools.sqltools.sql@default:default,org.eclipse.jst.ws.jaxws.dom.ui@default:default,org.eclipse.datatools.enablement.oda.ws@default:default,org.eclipse.datatools.connectivity.oda.consumer@default:default,org.eclipse.jst.common.ui@default:default,org.eclipse.swt.win32.win32.x86_64@default:false,org.eclipse.jst.ws.jaxws.dom.doc.isv@default:default,org.eclipse.jem.beaninfo@default:default,org.eclipse.jst.jsp.core@default:default,org.eclipse.team.cvs.ssh2@default:default,org.eclipse.emf.codegen.ui@default:default,java_cup.runtime@default:default,org.eclipse.jpt.eclipselink.core@default:default,org.mortbay.jetty.server@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.wst.xml.xpath.core@default:default,org.eclipse.wst.wsi.ui@default:default,org.eclipse.datatools.enablement.ibm.db2.iseries.ui@default:default,org.eclipse.wst.jsdt.web.core@default:default,org.eclipse.jst.j2ee.xdoclet.runtime@default:default,org.eclipse.test.performance@default:default,org.eclipse.datatools.help@default:default,org.eclipse.ant.launching@default:default,org.eclipse.datatools.enablement.postgresql@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.core.filebuffers@default:default,org.eclipse.jdt.doc.isv@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.equinox.jsp.jasper.registry@default:default,org.eclipse.jst.ws.consumption.infopop@default:default,org.eclipse.jdt.core@default:default,org.eclipse.datatools.enablement.sybase@default:default,org.eclipse.wst.xml.core@default:default,org.eclipse.jst.server.ui.doc.user@default:default,org.eclipse.emf.mapping.ecore2ecore.editor@default:default,org.eclipse.wst.wsdl@default:default,org.eclipse.datatools.sqltools.common.ui@default:default,org.eclipse.wst.server.preview.adapter@default:default,org.eclipse.datatools.common.doc.user@default:default,org.eclipse.jst.common.annotations.core@default:default,javax.activation@default:default,org.eclipse.wst.command.env.core@default:default,org.eclipse.emf@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.jst.standard.schemas@default:default,org.eclipse.jst.ws.jaxb.core@default:default,org.eclipse.datatools.enablement.ibm.db2.luw.dbdefinition@default:default,org.apache.velocity@default:default,org.eclipse.jpt.jaxb.branding@default:default,javax.servlet.jsp@default:default,org.eclipse.servertools.doc.isv@default:default,org.eclipse.datatools.enablement.hsqldb@default:default,org.eclipse.jst.ws.axis.ui.doc.user@default:default,org.eclipse.help.base@default:default,org.eclipse.help.appserver@default:default,org.eclipse.test.performance.win32@default:false,org.eclipse.datatools.sqltools.parsers.sql.xml.query@default:default,org.eclipse.equinox.p2.updatechecker@default:default,org.eclipse.jst.j2ee.core@default:default,org.eclipse.wst.xml.ui@default:default,org.eclipse.wst.jsdt.debug.transport@default:default,org.eclipse.jst.ws.axis.infopop@default:default,org.eclipse.jdt.doc.user@default:default,org.eclipse.emf.example.installer@default:default,org.eclipse.ui.net@default:default,org.eclipse.wst.xsl.core@default:default,org.eclipse.wst.css.core@default:default,org.eclipse.wst.ws.service.policy.ui@default:default,org.eclipse.wst.jsdt.support.firefox@default:default,org.eclipse.jst.pagedesigner.jsf.ui@default:default,org.eclipse.wst.dtd.core@default:default,org.eclipse.equinox.p2.ql@default:default,org.eclipse.wst.jsdt.debug.ui@default:default,org.eclipse.sdk@default:default,org.eclipse.datatools.modelbase.sql.query@default:default,org.eclipse.wst.xml.xpath2@default:default,org.eclipse.jst.j2ee.doc.user@default:default,org.eclipse.jst.servlet.ui@default:default,org.objectweb.asm@default:default,org.eclipse.datatools.modelbase.derby@default:default,org.eclipse.core.runtime.compatibility@default:default,org.eclipse.wst.xml.xpath.ui@default:default,org.eclipse.xsd@default:default,org.eclipse.jdt.apt.ui@default:default,org.eclipse.wst.wsdl.validation@default:default,org.eclipse.emf.mapping.ecore@default:default,org.eclipse.jem.proxy@default:default,org.eclipse.datatools.connectivity.oda.template.ui@default:default,org.eclipse.jst.server.generic.jonas@default:default,org.eclipse.wst.ws.service.policy@default:default,org.jdom*1.0.0.v201005080400@default:default,org.eclipse.jst.ws.axis.creation.ui@default:default,org.eclipse.jpt.eclipselink.branding@default:default,org.eclipse.datatools.modelbase.sql@default:default,org.eclipse.wst.common.core@default:default,org.eclipse.jst.jsf.standard.tagsupport@default:default,org.eclipse.datatools.enablement.ibm.informix.ui@default:default,org.eclipse.jst.jsf.doc.dev@default:default,org.eclipse.jst.jee.web@default:default,org.eclipse.wst.validation.doc.isv@default:default,org.eclipse.datatools.sqltools.ddlgen.ui@default:default,org.eclipse.wst.webtools.doc.user@default:default,org.eclipse.compare.win32@default:default,org.eclipse.emf.databinding@default:default,org.eclipse.emf.ecore.change.edit@default:default,org.eclipse.jst.jee@default:default,org.eclipse.rcp@default:default,org.eclipse.jpt.db@default:default,org.eclipse.datatools.sqltools.sql.ui@default:default,org.eclipse.wst.common.modulecore@default:default,org.eclipse.equinox.jsp.jasper@default:default,org.eclipse.jst.ws.axis2.consumption.core@default:default,org.eclipse.xsd.ecore.importer@default:default,org.eclipse.jst.server.generic.ui@default:default,org.eclipse.datatools.enablement.oracle.dbdefinition@default:default,org.eclipse.wst.sse.ui.infopop@default:default,org.eclipse.jst.ws.axis2.ui@default:default,org.eclipse.xsd.example.installer@default:default,org.eclipse.equinox.p2.touchpoint.eclipse@default:default,org.eclipse.emf.importer.ecore@default:default,org.eclipse.emf.mapping.xsd2ecore.editor@default:default,org.eclipse.jst.ws.creation.ejb.ui@default:default,org.eclipse.ant.ui@default:default,org.eclipse.datatools.sqltools.parsers.sql.query@default:default,org.eclipse.core.databinding@default:default,org.eclipse.core.variables@default:default,org.junit*4.8.1.v4_8_1_v20100427-1100@default:default,org.eclipse.jst.ws.cxf.creation.ui@default:default,org.eclipse.compare@default:default,org.eclipse.wst.wsi.ui.doc.user@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.jst.pagedesigner.jsp.core@default:default,org.apache.log4j@default:default,org.easymock@default:default,org.eclipse.equinox.ds@1:true,javax.xml.ws@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.platform@default:default,org.eclipse.datatools.intro@default:default,org.eclipse.equinox.event@default:default,org.eclipse.datatools.connectivity.oda.profile@default:default,org.eclipse.wst.web@default:default,org.eclipse.emf.mapping.ecore2ecore@default:default,javax.xml.soap@default:default,org.eclipse.platform.doc.isv@default:default,org.eclipse.jst.ws.jaxws.doc.isv@default:default,org.eclipse.jpt.gen@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.emf.mapping.ui@default:default,org.eclipse.emf.importer.rose@default:default,org.eclipse.pde.build@default:default,org.eclipse.datatools.connectivity.oda.design.ui@default:default,org.eclipse.help@default:default,org.eclipse.wst.common.frameworks@default:default,org.eclipse.datatools.enablement.sybase.ase.dbdefinition@default:default,org.apache.commons.httpclient@default:default,org.eclipse.equinox.util@default:default,org.jdom*1.1.1.v201101151400@default:default,com.ibm.icu@default:default,org.eclipse.ui.browser@default:default,org.eclipse.equinox.p2.directorywatcher@default:default,org.eclipse.ui.editors@default:default,org.eclipse.emf.mapping@default:default,org.eclipse.equinox.p2.updatesite@default:default,org.eclipse.osgi.util@default:default,org.eclipse.jem@default:default,org.eclipse.xsd.cheatsheets@default:default,org.eclipse.wst.command.env.doc.user@default:default"/>
305
<stringAttribute key="selected_workspace_plugins" value="org.eclipse.jpt.utility.tests@default:default,org.eclipse.jpt.core.tests@default:default,org.eclipse.jpt.eclipselink.ui@default:default,org.eclipse.jpt.ui.tests@default:default,org.eclipse.jpt.db.tests@default:default,org.eclipse.jpt.utility@default:default,org.eclipse.jpt.jpa.core.tests@default:false,org.eclipse.persistence.jpa.query.test@default:default,org.eclipse.jpt.core@default:default,org.eclipse.jpt.db@default:default,org.eclipse.jpt.gen@default:default,org.eclipse.jpt.core.tests.extension.resource@default:default,org.eclipse.jpt.db.ui@default:default,org.eclipse.jpt.eclipselink.core.tests@default:default,org.eclipse.jpt@default:default,org.eclipse.jpt.ui@default:default,org.eclipse.jpt.jpa.jpql@default:default,org.eclipse.persistence.jpa.query@default:default,org.eclipse.jpt.eclipselink.core@default:default,org.eclipse.jpt.doc.user@default:default,org.eclipse.persistence.jpa@default:default"/>
306
<booleanAttribute key="show_selected_only" value="false"/>
307
<stringAttribute key="templateConfig" value="${target_home}\configuration\config.ini"/>
308
<booleanAttribute key="tracing" value="false"/>
309
<booleanAttribute key="useCustomFeatures" value="false"/>
310
<booleanAttribute key="useDefaultConfig" value="true"/>
311
<booleanAttribute key="useDefaultConfigArea" value="false"/>
312
<booleanAttribute key="useProduct" value="true"/>
313
</launchConfiguration>
(-)META-INF/MANIFEST.MF (+3 lines)
Lines 19-24 Link Here
19
 org.eclipse.jpt.jpa.db;bundle-version="[2.0.0,3.0.0)",
19
 org.eclipse.jpt.jpa.db;bundle-version="[2.0.0,3.0.0)",
20
 org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)",
20
 org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)",
21
 org.eclipse.jpt.common.utility.tests;bundle-version="[2.0.0,3.0.0)",
21
 org.eclipse.jpt.common.utility.tests;bundle-version="[2.0.0,3.0.0)",
22
 org.eclipse.jst.common.project.facet.core;bundle-version="1.4.200",
23
 org.eclipse.persistence.jpa.jpql;bundle-version="2.3.0",
24
 org.eclipse.persistence.jpa.jpql.test;bundle-version="2.3.0",
22
 org.eclipse.wst.common.emf;bundle-version="[1.1.200,2.0.0)",
25
 org.eclipse.wst.common.emf;bundle-version="[1.1.200,2.0.0)",
23
 org.eclipse.wst.common.emfworkbench.integration;bundle-version="[1.1.200,2.0.0)",
26
 org.eclipse.wst.common.emfworkbench.integration;bundle-version="[1.1.200,2.0.0)",
24
 org.eclipse.wst.common.frameworks;bundle-version="[1.1.200,2.0.0)",
27
 org.eclipse.wst.common.frameworks;bundle-version="[1.1.200,2.0.0)",
(-)src/org/eclipse/jpt/jpa/core/tests/internal/jpql/AllJPQLQueryTests.java (+75 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2011 Oracle. All rights reserved.
3
 * This program and the accompanying materials are made available under the 
4
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
5
 * which accompanies this distribution. 
6
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
7
 * and the Eclipse Distribution License is available at 
8
 * http://www.eclipse.org/org/documents/edl-v10.php.
9
 *
10
 * Contributors:
11
 *     Oracle - initial API and implementation
12
 *
13
 ******************************************************************************/
14
package org.eclipse.jpt.jpa.core.tests.internal.jpql;
15
16
import junit.extensions.TestSetup;
17
import junit.framework.JUnit4TestAdapter;
18
import junit.framework.Test;
19
import junit.framework.TestSuite;
20
import org.eclipse.persistence.jpa.jpql.AbstractJPQLQueryTest;
21
import org.eclipse.persistence.jpa.jpql.ContentAssistTest;
22
import org.eclipse.persistence.jpa.jpql.GrammarValidatorTest;
23
import org.eclipse.persistence.jpa.jpql.SemanticValidatorTest;
24
25
/**
26
 * The test suite for the JPQL parsing system.
27
 *
28
 * @version 3.0
29
 * @since 3.0
30
 * @author Pascal Filion
31
 */
32
@SuppressWarnings("nls")
33
public final class AllJPQLQueryTests {
34
35
	public AllJPQLQueryTests() {
36
		super();
37
	}
38
39
	public static Test buildAllTests() {
40
41
		TestSuite suite = new TestSuite("JPQL Query Tests");
42
43
		// JpaJpqlQueryHelper
44
		suite.addTest(new JUnit4TestAdapter(JpaORMEntityQueryHelperTest.class));
45
		suite.addTest(new JUnit4TestAdapter(JpaORMQueryHelperTest.class));
46
		suite.addTest(new JUnit4TestAdapter(JpaPersistenceUnitEntityQueryHelperTest.class));
47
48
		// Validation
49
		suite.addTest(new JUnit4TestAdapter(GrammarValidatorTest.class));
50
		suite.addTest(new JUnit4TestAdapter(SemanticValidatorTest.class));
51
52
		// Content Assist
53
		suite.addTest(new JUnit4TestAdapter(ContentAssistTest.class));
54
55
		return buildBatchTestSuite(suite);
56
	}
57
58
	private static TestSetup buildBatchTestSuite(Test test) {
59
		return new TestSetup(test) {
60
			@Override
61
			protected void setUp() throws Exception {
62
				AbstractJPQLQueryTest.setUpClass();
63
			}
64
			@Override
65
			protected void tearDown() throws Exception {
66
				AbstractJPQLQueryTest.tearDownClass();
67
			}
68
		};
69
	}
70
71
	public static Test suite() {
72
		AbstractJPQLQueryTest.setJPQLQueryTestHelper(new JpaJpqlQueryTestHelper());
73
		return buildAllTests();
74
	}
75
}
(-)src/org/eclipse/jpt/jpa/core/tests/internal/jpql/JpaJpqlQueryTestHelper.java (+272 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2011 Oracle. All rights reserved.
3
 * This program and the accompanying materials are made available under the 
4
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
5
 * which accompanies this distribution. 
6
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
7
 * and the Eclipse Distribution License is available at 
8
 * http://www.eclipse.org/org/documents/edl-v10.php.
9
 *
10
 * Contributors:
11
 *     Oracle - initial API and implementation
12
 *
13
 ******************************************************************************/
14
package org.eclipse.jpt.jpa.core.tests.internal.jpql;
15
16
import java.util.HashMap;
17
import java.util.Iterator;
18
import java.util.ListIterator;
19
import java.util.Map;
20
import org.eclipse.core.resources.IFolder;
21
import org.eclipse.core.resources.IProject;
22
import org.eclipse.core.resources.IResource;
23
import org.eclipse.core.resources.IWorkspaceRoot;
24
import org.eclipse.core.runtime.IPath;
25
import org.eclipse.core.runtime.NullProgressMonitor;
26
import org.eclipse.core.runtime.Path;
27
import org.eclipse.jdt.core.IClasspathEntry;
28
import org.eclipse.jdt.core.IJavaProject;
29
import org.eclipse.jdt.core.JavaCore;
30
import org.eclipse.jdt.core.JavaModelException;
31
import org.eclipse.jpt.common.core.tests.internal.projects.TestFacetedProject;
32
import org.eclipse.jpt.common.utility.internal.ArrayTools;
33
import org.eclipse.jpt.jpa.core.JpaFacet;
34
import org.eclipse.jpt.jpa.core.JpaProject;
35
import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
36
import org.eclipse.jpt.jpa.core.context.JpaRootContextNode;
37
import org.eclipse.jpt.jpa.core.context.MappingFile;
38
import org.eclipse.jpt.jpa.core.context.NamedQuery;
39
import org.eclipse.jpt.jpa.core.context.PersistentType;
40
import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
41
import org.eclipse.jpt.jpa.core.context.orm.OrmNamedQuery;
42
import org.eclipse.jpt.jpa.core.context.persistence.MappingFileRef;
43
import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
44
import org.eclipse.jpt.jpa.core.internal.jpql.JpaMappingFile;
45
import org.eclipse.jpt.jpa.core.internal.jpql.JpaPersistenceUnit;
46
import org.eclipse.jpt.jpa.core.internal.jpql.JpaQuery;
47
import org.eclipse.jpt.jpa.core.tests.internal.projects.TestJpaProject;
48
import org.eclipse.jst.common.project.facet.core.JavaFacet;
49
import org.eclipse.persistence.jpa.internal.jpql.VirtualQuery;
50
import org.eclipse.persistence.jpa.jpql.IORMConfiguration;
51
import org.eclipse.persistence.jpa.jpql.JPQLQueryTestHelper;
52
import org.eclipse.persistence.jpa.jpql.spi.IManagedTypeProvider;
53
import org.eclipse.persistence.jpa.jpql.spi.IQuery;
54
55
/**
56
 * This helper gives to the unit-tests the access to the application metadata through JPT API.
57
 * 
58
 * @version 3.0
59
 * @since 3.0
60
 * @author Pascal Filion
61
 */
62
@SuppressWarnings({ "nls", "restriction" })
63
public final class JpaJpqlQueryTestHelper implements JPQLQueryTestHelper {
64
65
	/**
66
	 * Flag used to prevent the project metadata to be created more than once.
67
	 */
68
	private boolean initialized;
69
70
	/**
71
	 * The JPA project used to test the JPQL query API.
72
	 */
73
	private JpaProject jpaProject;
74
75
	/**
76
	 * 
77
	 */
78
	private Map<String, IORMConfiguration> ormConfigurations;
79
80
	/**
81
	 * 
82
	 */
83
	private IManagedTypeProvider persistenceUnit;
84
85
	/**
86
	 * The VM argument used to locate the source folder defined in the JPQL Query Unit-Tests.
87
	 */
88
	private static final String RESOURCE_LOCATION = "test.query.jpql.resource.source";
89
90
	private void addClasspathEntry(IJavaProject javaProject, IClasspathEntry entry) throws JavaModelException {
91
		javaProject.setRawClasspath(ArrayTools.add(javaProject.getRawClasspath(), entry), null);
92
	}
93
94
	private void addJar(IJavaProject javaProject, String jarPath) throws JavaModelException {
95
		this.addClasspathEntry(javaProject, JavaCore.newLibraryEntry(new Path(jarPath), null, null));
96
	}
97
98
	/**
99
	 * {@inheritDoc}
100
	 */
101
//	@Override
102
	public IQuery buildNamedQuery(String query) throws Exception {
103
		return new VirtualQuery(getPersistenceUnit(), query);
104
	}
105
106
	private IORMConfiguration buildORMConfiguration(String ormXmlFileName) {
107
		return new JpaORMConfiguration(jpaProject, getMappingFile(ormXmlFileName));
108
	}
109
110
	private PersistenceUnit getJpaPersistenceUnit() {
111
		return getRootContextNode().getPersistenceXml().getPersistence().persistenceUnits().next();
112
	}
113
114
	private MappingFile getMappingFile(String ormXmlFileName) {
115
		for (Iterator<MappingFileRef> iter = getJpaPersistenceUnit().mappingFileRefs(); iter.hasNext(); ) {
116
			MappingFileRef mappingFileRef = iter.next();
117
			if (mappingFileRef.getFileName().equals("META-INF/" + ormXmlFileName)) {
118
				mappingFileRef.update();
119
				return mappingFileRef.getMappingFile();
120
			}
121
		}
122
		return null;
123
	}
124
125
	/**
126
	 * {@inheritDoc}
127
	 */
128
	public IORMConfiguration getORMConfiguration(String ormXmlFileName) throws Exception {
129
130
		if (ormConfigurations == null) {
131
			ormConfigurations = new HashMap<String, IORMConfiguration>();
132
		}
133
134
		IORMConfiguration ormConfiguration = ormConfigurations.get(ormXmlFileName);
135
136
		if (ormConfiguration == null) {
137
			ormConfiguration = buildORMConfiguration(ormXmlFileName);
138
			ormConfigurations.put(ormXmlFileName, ormConfiguration);
139
		}
140
141
		return ormConfiguration;
142
	}
143
144
	/**
145
	 * {@inheritDoc}
146
	 */
147
	public IManagedTypeProvider getPersistenceUnit() throws Exception {
148
		if (persistenceUnit == null) {
149
			persistenceUnit = new JpaPersistenceUnit(jpaProject, getJpaPersistenceUnit());
150
		}
151
		return persistenceUnit;
152
	}
153
154
	private JpaRootContextNode getRootContextNode() {
155
		return jpaProject.getRootContextNode();
156
	}
157
158
	/**
159
	 * {@inheritDoc}
160
	 */
161
	public void setUp() throws Exception {
162
	}
163
164
	/**
165
	 * {@inheritDoc}
166
	 */
167
	public void setUpBefore() throws Exception {
168
		if (!initialized) {
169
			initialized = true;
170
			setUpProject();
171
		}
172
	}
173
174
	private void setUpProject() throws Exception {
175
176
		// Create the projects
177
		TestFacetedProject facetedProject = TestFacetedProject.buildFacetedProject("JPQL Query Tests", false);
178
		facetedProject.getFacetedProject().installProjectFacet(JavaFacet.VERSION_1_6, null, new NullProgressMonitor());
179
		facetedProject.installFacet("jst.utility", "1.0");
180
181
		IProject project = facetedProject.getProject();
182
		IJavaProject javaProject = JavaCore.create(project);
183
		IWorkspaceRoot workspaceRoot = project.getWorkspace().getRoot();
184
185
		// Create the location so the Eclipse project can see the unit-tests files
186
		IPath sourcePath = project.getFullPath().append("src");
187
		IFolder sourceFolder = workspaceRoot.getFolder(sourcePath);
188
		sourceFolder.delete(true, new NullProgressMonitor());
189
190
		// Create the symbolic link to the actual location
191
		IPath unitTestSourcePath = new Path(System.getProperty(RESOURCE_LOCATION));
192
		sourceFolder.createLink(unitTestSourcePath, IResource.ALLOW_MISSING_LOCAL, new NullProgressMonitor());
193
194
		addJar(javaProject, TestJpaProject.jpaJarName());
195
		addJar(javaProject, TestJpaProject.eclipseLinkJarName());
196
197
		// Now create the JPA project
198
		facetedProject.getFacetedProject().installProjectFacet(JpaFacet.VERSION_2_0, null, new NullProgressMonitor());
199
		jpaProject = JptJpaCorePlugin.getJpaProject(project);
200
		jpaProject.setDiscoversAnnotatedClasses(true);
201
	}
202
203
	/**
204
	 * {@inheritDoc}
205
	 */
206
	public void tearDown() throws Exception {
207
	}
208
209
	/**
210
	 * {@inheritDoc}
211
	 */
212
	public void tearDownAfter() throws Exception {
213
		initialized = false;
214
		ormConfigurations = null;
215
		persistenceUnit = null;
216
		jpaProject.getProject().delete(true, new NullProgressMonitor());
217
		jpaProject = null;
218
	}
219
220
	private class JpaORMConfiguration extends JpaMappingFile
221
	                                  implements IORMConfiguration {
222
223
		/**
224
		 * The cached used to quickly retrieve any queries that have been cached.
225
		 */
226
		private Map<String, IQuery> queries;
227
228
		JpaORMConfiguration(JpaProject jpaProject, MappingFile mappingFile) {
229
			super(jpaProject, mappingFile);
230
		}
231
232
		private IQuery buildQuery(NamedQuery namedQuery) {
233
			return new JpaQuery(this, namedQuery);
234
		}
235
236
		private EntityMappings getEntityMappings() {
237
			return (EntityMappings) getPersistentTypeContainer().getRoot();
238
		}
239
240
		/**
241
		 * {@inheritDoc}
242
		 */
243
		public IQuery getNamedQuery(String queryName) {
244
			initializeQueries();
245
			return queries.get(queryName);
246
		}
247
248
		private void initializeQueries() {
249
250
			if (queries == null) {
251
				queries = new HashMap<String, IQuery>();
252
253
				for (ListIterator<OrmNamedQuery> iter = namedQueries(); iter.hasNext(); ) {
254
					OrmNamedQuery namedQuery = iter.next();
255
					queries.put(namedQuery.getName(), buildQuery(namedQuery));
256
				}
257
			}
258
		}
259
260
		private ListIterator<OrmNamedQuery> namedQueries() {
261
			return getEntityMappings().getQueryContainer().namedQueries();
262
		}
263
264
		/**
265
		 * {@inheritDoc}
266
		 */
267
		@Override
268
		protected Iterator<? extends PersistentType> persistenceTypes() {
269
			return getPersistentTypeContainer().getPersistentTypes().iterator();
270
		}
271
	}
272
}
(-)src/org/eclipse/jpt/jpa/core/tests/internal/jpql/JpaORMEntityQueryHelperTest.java (+38 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2011 Oracle. All rights reserved.
3
 * This program and the accompanying materials are made available under the 
4
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
5
 * which accompanies this distribution. 
6
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
7
 * and the Eclipse Distribution License is available at 
8
 * http://www.eclipse.org/org/documents/edl-v10.php.
9
 *
10
 * Contributors:
11
 *     Oracle - initial API and implementation
12
 *
13
 ******************************************************************************/
14
package org.eclipse.jpt.jpa.core.tests.internal.jpql;
15
16
import org.eclipse.jpt.jpa.core.context.NamedQuery;
17
import org.eclipse.jpt.jpa.core.internal.jpql.JpaJpqlQueryHelper;
18
import org.eclipse.persistence.jpa.jpql.JPQLQueryHelper;
19
import org.eclipse.persistence.jpa.jpql.ORMEntityJPQLQueryHelperTest;
20
import org.eclipse.persistence.jpa.jpql.spi.IQuery;
21
22
/**
23
 * Tests {@link AbstractQueryHelper} using named queries on an entity defined in an ORM configuration.
24
 *
25
 * @version 3.0
26
 * @since 3.0
27
 * @author Pascal Filion
28
 */
29
public final class JpaORMEntityQueryHelperTest extends ORMEntityJPQLQueryHelperTest<NamedQuery> {
30
31
	/**
32
	 * {@inheritDoc}
33
	 */
34
	@Override
35
	protected JPQLQueryHelper<NamedQuery> buildQueryHelper(IQuery namedQuery) throws Exception {
36
		return new JpaJpqlQueryHelper(namedQuery);
37
	}
38
}
(-)src/org/eclipse/jpt/jpa/core/tests/internal/jpql/JpaORMQueryHelperTest.java (+38 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2011 Oracle. All rights reserved.
3
 * This program and the accompanying materials are made available under the 
4
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
5
 * which accompanies this distribution. 
6
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
7
 * and the Eclipse Distribution License is available at 
8
 * http://www.eclipse.org/org/documents/edl-v10.php.
9
 *
10
 * Contributors:
11
 *     Oracle - initial API and implementation
12
 *
13
 ******************************************************************************/
14
package org.eclipse.jpt.jpa.core.tests.internal.jpql;
15
16
import org.eclipse.jpt.jpa.core.context.NamedQuery;
17
import org.eclipse.jpt.jpa.core.internal.jpql.JpaJpqlQueryHelper;
18
import org.eclipse.persistence.jpa.jpql.JPQLQueryHelper;
19
import org.eclipse.persistence.jpa.jpql.ORMJPQLQueryHelperTest;
20
import org.eclipse.persistence.jpa.jpql.spi.IQuery;
21
22
/**
23
 * Tests {@link AbstractQueryHelper} using named queries on an ORM configuration.
24
 *
25
 * @version 3.0
26
 * @since 3.0
27
 * @author Pascal Filion
28
 */
29
public final class JpaORMQueryHelperTest extends ORMJPQLQueryHelperTest<NamedQuery> {
30
31
	/**
32
	 * {@inheritDoc}
33
	 */
34
	@Override
35
	protected JPQLQueryHelper<NamedQuery> buildQueryHelper(IQuery namedQuery) throws Exception {
36
		return new JpaJpqlQueryHelper(namedQuery);
37
	}
38
}
(-)src/org/eclipse/jpt/jpa/core/tests/internal/jpql/JpaPersistenceUnitEntityQueryHelperTest.java (+38 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2011 Oracle. All rights reserved.
3
 * This program and the accompanying materials are made available under the 
4
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
5
 * which accompanies this distribution. 
6
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
7
 * and the Eclipse Distribution License is available at 
8
 * http://www.eclipse.org/org/documents/edl-v10.php.
9
 *
10
 * Contributors:
11
 *     Oracle - initial API and implementation
12
 *
13
 ******************************************************************************/
14
package org.eclipse.jpt.jpa.core.tests.internal.jpql;
15
16
import org.eclipse.jpt.jpa.core.context.NamedQuery;
17
import org.eclipse.jpt.jpa.core.internal.jpql.JpaJpqlQueryHelper;
18
import org.eclipse.persistence.jpa.jpql.JPQLQueryHelper;
19
import org.eclipse.persistence.jpa.jpql.PersistenceUnitEntityJPQLQueryHelperTest;
20
import org.eclipse.persistence.jpa.jpql.spi.IQuery;
21
22
/**
23
 * Tests {@link AbstractQueryHelper} using named queries on an entity defined in a persistence unit.
24
 *
25
 * @version 3.0
26
 * @since 3.0
27
 * @author Pascal Filion
28
 */
29
public final class JpaPersistenceUnitEntityQueryHelperTest extends PersistenceUnitEntityJPQLQueryHelperTest<NamedQuery> {
30
31
	/**
32
	 * {@inheritDoc}
33
	 */
34
	@Override
35
	protected JPQLQueryHelper<NamedQuery> buildQueryHelper(IQuery namedQuery) throws Exception {
36
		return new JpaJpqlQueryHelper(namedQuery);
37
	}
38
}
(-)META-INF/MANIFEST.MF (+2 lines)
Lines 32-37 Link Here
32
 org.eclipse.jst.common.project.facet.ui;bundle-version="[1.3.100,2.0.0)",
32
 org.eclipse.jst.common.project.facet.ui;bundle-version="[1.3.100,2.0.0)",
33
 org.eclipse.jst.j2ee;bundle-version="[1.1.200,2.0.0)",
33
 org.eclipse.jst.j2ee;bundle-version="[1.1.200,2.0.0)",
34
 org.eclipse.jst.j2ee.ui;bundle-version="[1.1.200,2.0.0)",
34
 org.eclipse.jst.j2ee.ui;bundle-version="[1.1.200,2.0.0)",
35
 org.eclipse.persistence.jpa.jpql;bundle-version="1.0.0",
35
 org.eclipse.ui.ide;bundle-version="[3.4.0,4.0.0)",
36
 org.eclipse.ui.ide;bundle-version="[3.4.0,4.0.0)",
36
 org.eclipse.ui.views.properties.tabbed;bundle-version="[3.4.0,4.0.0)",
37
 org.eclipse.ui.views.properties.tabbed;bundle-version="[3.4.0,4.0.0)",
37
 org.eclipse.ui.navigator;bundle-version="[3.3.100,4.0.0)",
38
 org.eclipse.ui.navigator;bundle-version="[3.3.100,4.0.0)",
Lines 64-69 Link Here
64
 org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.connection;x-internal:=true,
65
 org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.connection;x-internal:=true,
65
 org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.options;x-internal:=true,
66
 org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.options;x-internal:=true,
66
 org.eclipse.jpt.jpa.ui.internal.jpa2.platform.generic;x-internal:=true,
67
 org.eclipse.jpt.jpa.ui.internal.jpa2.platform.generic;x-internal:=true,
68
 org.eclipse.jpt.jpa.ui.internal.jpql;x-internal:=true,
67
 org.eclipse.jpt.jpa.ui.internal.listeners;x-internal:=true,
69
 org.eclipse.jpt.jpa.ui.internal.listeners;x-internal:=true,
68
 org.eclipse.jpt.jpa.ui.internal.menus;x-internal:=true,
70
 org.eclipse.jpt.jpa.ui.internal.menus;x-internal:=true,
69
 org.eclipse.jpt.jpa.ui.internal.navigator;x-internal:=true,
71
 org.eclipse.jpt.jpa.ui.internal.navigator;x-internal:=true,
(-)plugin.properties (+1 lines)
Lines 66-71 Link Here
66
jpaDetails = JPA Details
66
jpaDetails = JPA Details
67
jpaStructure = JPA Structure
67
jpaStructure = JPA Structure
68
JpaProposalCategory = JPA Proposals
68
JpaProposalCategory = JPA Proposals
69
JpaJpqlProposalCategory = JPA JPQL Proposals
69
70
70
JptCreationActionSet.label = Jpt Creation
71
JptCreationActionSet.label = Jpt Creation
71
JptCreationActionSet.description = Jpt Creation Action Set
72
JptCreationActionSet.description = Jpt Creation Action Set
(-)plugin.xml (-3 / +24 lines)
Lines 69-78 Link Here
69
			<partition type="__dftl_partition_content_type"/>
69
			<partition type="__dftl_partition_content_type"/>
70
			<partition type="__java_string"/>
70
			<partition type="__java_string"/>
71
		</javaCompletionProposalComputer>
71
		</javaCompletionProposalComputer>
72
		
72
73
	</extension>
73
	</extension>
74
	
74
75
	
76
	<extension
75
	<extension
77
		point="org.eclipse.jdt.ui.javaCompletionProposalComputer"
76
		point="org.eclipse.jdt.ui.javaCompletionProposalComputer"
78
		id="jpaProposalCategory"
77
		id="jpaProposalCategory"
Lines 80-85 Link Here
80
		<proposalCategory
79
		<proposalCategory
81
			icon="$nl$/icons/full/eview16/jpa_perspective.gif"/>
80
			icon="$nl$/icons/full/eview16/jpa_perspective.gif"/>
82
	</extension>
81
	</extension>
82
83
	<extension
84
		point="org.eclipse.jdt.ui.javaCompletionProposalComputer"
85
		id="JpaJpqlCompletionProposalComputer">
86
87
		<javaCompletionProposalComputer
88
        activate="true"
89
        categoryId="org.eclipse.jpt.jpa.ui.jpaJpqlProposalCategory"
90
        class="org.eclipse.jpt.jpa.ui.internal.jpql.JpaJpqlQueryCompletionProposalComputer">
91
			<partition type="__dftl_partition_content_type"/>
92
			<partition type="__java_string"/>
93
		</javaCompletionProposalComputer>
94
		
95
	</extension>
96
97
	<extension
98
		point="org.eclipse.jdt.ui.javaCompletionProposalComputer"
99
		id="jpaJpqlProposalCategory"
100
		name="%JpaJpqlProposalCategory">
101
		<proposalCategory
102
			icon="$nl$/icons/full/eview16/jpa_perspective.gif"/>
103
	</extension>
83
	
104
	
84
	
105
	
85
	<extension
106
	<extension
(-)src/org/eclipse/jpt/jpa/ui/internal/JptUiIcons.java (-1 / +10 lines)
Lines 124-127 Link Here
124
	public static final String TRANSIENT = "full/obj16/transient";
124
	public static final String TRANSIENT = "full/obj16/transient";
125
	
125
	
126
	public static final String NULL_ATTRIBUTE_MAPPING = "full/obj16/null-attribute-mapping";
126
	public static final String NULL_ATTRIBUTE_MAPPING = "full/obj16/null-attribute-mapping";
127
}
127
128
129
	// **************** Content Assist icons **********************************
130
131
	public static final String JPQL_FUNCTION = "full/obj16/jpql.function";
132
133
	public static final String JPQL_IDENTIFIER = "full/obj16/jpql.identifier";
134
135
	public static final String JPQL_VARIABLE = "full/obj16/jpql.variable";
136
}
(-)src/org/eclipse/jpt/jpa/ui/internal/jpql/JpaJpqlQueryCompletionProposalComputer.java (+565 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2011 Oracle. All rights reserved.
3
 * This program and the accompanying materials are made available under the 
4
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
5
 * which accompanies this distribution. 
6
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
7
 * and the Eclipse Distribution License is available at 
8
 * http://www.eclipse.org/org/documents/edl-v10.php.
9
 *
10
 * Contributors:
11
 *     Oracle - initial API and implementation
12
 *
13
 ******************************************************************************/
14
package org.eclipse.jpt.jpa.ui.internal.jpql;
15
16
import java.util.ArrayList;
17
import java.util.Collections;
18
import java.util.Iterator;
19
import java.util.List;
20
import org.eclipse.core.resources.IFile;
21
import org.eclipse.core.runtime.IProgressMonitor;
22
import org.eclipse.core.runtime.IStatus;
23
import org.eclipse.core.runtime.Status;
24
import org.eclipse.jdt.core.CompletionContext;
25
import org.eclipse.jdt.core.ICompilationUnit;
26
import org.eclipse.jdt.core.IJavaProject;
27
import org.eclipse.jdt.core.JavaModelException;
28
import org.eclipse.jdt.core.dom.CompilationUnit;
29
import org.eclipse.jdt.ui.PreferenceConstants;
30
import org.eclipse.jdt.ui.text.java.ContentAssistInvocationContext;
31
import org.eclipse.jdt.ui.text.java.IJavaCompletionProposalComputer;
32
import org.eclipse.jdt.ui.text.java.JavaContentAssistInvocationContext;
33
import org.eclipse.jface.resource.ImageDescriptor;
34
import org.eclipse.jface.resource.ImageRegistry;
35
import org.eclipse.jface.text.contentassist.CompletionProposal;
36
import org.eclipse.jface.text.contentassist.ICompletionProposal;
37
import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
38
import org.eclipse.jpt.common.core.utility.TextRange;
39
import org.eclipse.jpt.jpa.core.JpaFile;
40
import org.eclipse.jpt.jpa.core.JpaStructureNode;
41
import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
42
import org.eclipse.jpt.jpa.core.context.NamedQuery;
43
import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
44
import org.eclipse.jpt.jpa.core.context.java.JavaNamedQuery;
45
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
46
import org.eclipse.jpt.jpa.core.context.java.JavaTypeMapping;
47
import org.eclipse.jpt.jpa.core.internal.jpql.JpaJpqlQueryHelper;
48
import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
49
import org.eclipse.jpt.jpa.ui.internal.JptUiIcons;
50
import org.eclipse.persistence.jpa.internal.jpql.parser.Expression;
51
import org.eclipse.persistence.jpa.internal.jpql.parser.IdentifierRole;
52
import org.eclipse.persistence.jpa.internal.jpql.parser.JPQLExpression;
53
import org.eclipse.persistence.jpa.jpql.ContentAssistItems;
54
import org.eclipse.persistence.jpa.jpql.ResultQuery;
55
import org.eclipse.persistence.jpa.jpql.spi.IEmbeddable;
56
import org.eclipse.persistence.jpa.jpql.spi.IEntity;
57
import org.eclipse.persistence.jpa.jpql.spi.IManagedType;
58
import org.eclipse.persistence.jpa.jpql.spi.IManagedTypeVisitor;
59
import org.eclipse.persistence.jpa.jpql.spi.IMappedSuperclass;
60
import org.eclipse.swt.graphics.Image;
61
import org.eclipse.swt.widgets.Display;
62
63
/**
64
 * This computer adds content completion to a JPQL query defined in a {@link javax.persistence.NamedQuery
65
 * &#64;NamedQuery}.
66
 * <p>
67
 * TODO: Add style to the display string by implementing ICompletionProposalExtension6.
68
 *       StyledString.QUALIFIER_STYLER
69
 *
70
 * @version 3.0
71
 * @since 3.0
72
 * @author Pascal Filion
73
 */
74
@SuppressWarnings({ "nls", "restriction" })
75
public final class JpaJpqlQueryCompletionProposalComputer implements IJavaCompletionProposalComputer {
76
77
	/**
78
	 * Flag used to determine if the word following the cursor should be overwritten or not.
79
	 */
80
	private boolean completionInserts;
81
82
	/**
83
	 * The provider of content assist items based on the position of the cursor within the JPQL query.
84
	 */
85
	private ContentAssistItems contentAssistItems;
86
87
	/**
88
	 * The local registry containing the images used to display the possible choices. The registry is
89
	 * disposed when the session ended.
90
	 */
91
	private ImageRegistry imageRegistry;
92
93
	/**
94
	 * This helper is responsible to retrieve the possible choices to complete or to add more
95
	 * information to a JPQL based on the position of the cursor.
96
	 */
97
	private JpaJpqlQueryHelper queryHelper;
98
99
	/**
100
	 * Creates a new <code>JpaQueryCompletionProposalComputer</code>.
101
	 */
102
	public JpaJpqlQueryCompletionProposalComputer() {
103
		super();
104
	}
105
106
	private Image abstractSchemaNameImage(String abstractSchemaName) {
107
		IManagedType managedType = queryHelper.getQuery().getProvider().getManagedType(abstractSchemaName);
108
		ManagedTypeVisitor visitor = new ManagedTypeVisitor();
109
		managedType.accept(visitor);
110
		return getImage(visitor.imageKey);
111
	}
112
113
	/**
114
	 * Adds {@link ICompletionProposal ICompletionProposals} for the abstract schema names that are
115
	 * possible choices.
116
	 *
117
	 * @param query The current value of the JPQL query
118
	 * @param position The position of the cursor within the JPQL query
119
	 * @param offset The position of the cursor within the document
120
	 * @param proposals The list used to store the new {@link ICompletionProposal ICompletionProposals}
121
	 */
122
	private void addAbstractSchemaNames(String query, int position, int offset, List<ICompletionProposal> proposals) {
123
		for (Iterator<String> iter = contentAssistItems.abstractSchemaNames(); iter.hasNext(); ) {
124
			ICompletionProposal proposal = buildAbstractSchemaNameProposal(query, iter.next(), position, offset);
125
			proposals.add(proposal);
126
		}
127
	}
128
129
	/**
130
	 * Adds {@link ICompletionProposal ICompletionProposals} for the identification variables that
131
	 * are possible choices.
132
	 *
133
	 * @param query The current value of the JPQL query
134
	 * @param position The position of the cursor within the JPQL query
135
	 * @param offset The position of the cursor within the document
136
	 * @param proposals The list used to store the new {@link ICompletionProposal ICompletionProposals}
137
	 */
138
	private void addIdentificationVariables(String query, int position, int offset, List<ICompletionProposal> proposals) {
139
		for (Iterator<String> iter = contentAssistItems.identificationVariables(); iter.hasNext(); ) {
140
			ICompletionProposal proposal = buildIdentificationVariableProposal(query, iter.next(), position, offset);
141
			proposals.add(proposal);
142
		}
143
	}
144
145
	/**
146
	 * Adds {@link ICompletionProposal ICompletionProposals} for the JPQL identifiers that are
147
	 * possible choices.
148
	 *
149
	 * @param query The current value of the JPQL query
150
	 * @param position The position of the cursor within the JPQL query
151
	 * @param offset The position of the cursor within the document
152
	 * @param proposals The list used to store the new {@link ICompletionProposal ICompletionProposals}
153
	 */
154
	private void addIdentifiers(String query, int position, int offset, List<ICompletionProposal> proposals) {
155
		for (Iterator<String> iter = contentAssistItems.identifiers(); iter.hasNext(); ) {
156
			ICompletionProposal proposal = buildIdentifierProposal(query, iter.next(), position, offset);
157
			proposals.add(proposal);
158
		}
159
	}
160
161
	/**
162
	 * Adds {@link ICompletionProposal ICompletionProposals} for the state fields and association
163
	 * fields that are possible choices.
164
	 *
165
	 * @param query The current value of the JPQL query
166
	 * @param position The position of the cursor within the JPQL query
167
	 * @param offset The position of the cursor within the document
168
	 * @param proposals The list used to store the new {@link ICompletionProposal ICompletionProposals}
169
	 */
170
	private void addProperties(String query, int position, int offset, List<ICompletionProposal> proposals) {
171
		for (Iterator<String> iter = contentAssistItems.properties(); iter.hasNext(); ) {
172
			ICompletionProposal proposal = buildPropertyProposal(query, iter.next(), position, offset);
173
			proposals.add(proposal);
174
		}
175
	}
176
177
	private ICompletionProposal buildAbstractSchemaNameProposal(String query,
178
	                                                            String choice,
179
	                                                            int position,
180
	                                                            int offset) {
181
182
		return buildProposal(
183
			query,
184
			choice,
185
			choice,
186
			abstractSchemaNameImage(choice),
187
			position,
188
			offset
189
		);
190
	}
191
192
	private String buildIdentificationVariableDisplayString(String identificationVariable) {
193
194
		String schemaName = contentAssistItems.getAbstractSchemaName(identificationVariable);
195
196
		if (schemaName != null) {
197
			identificationVariable += " : " + schemaName;
198
		}
199
200
		return identificationVariable;
201
	}
202
203
	private ICompletionProposal buildIdentificationVariableProposal(String query,
204
	                                                                String choice,
205
	                                                                int position,
206
	                                                                int offset) {
207
208
		return buildProposal(
209
			query,
210
			choice,
211
			buildIdentificationVariableDisplayString(choice),
212
			identificationVariableImage(),
213
			position,
214
			offset
215
		);
216
	}
217
218
	private ICompletionProposal buildIdentifierProposal(String query,
219
	                                                    String choice,
220
	                                                    int position,
221
	                                                    int offset) {
222
223
		IdentifierRole role = JPQLExpression.identifierRole(choice);
224
		boolean realFunction = (role == IdentifierRole.FUNCTION) && isRealFunction(choice);
225
		int cursorOffset = 0;
226
227
		// For JPQL function, we add () to the display string, example: AVG()
228
		// But for TRUE, FALSE, etc, we don't add ()
229
		if (realFunction) {
230
			choice += "()";
231
			cursorOffset--;
232
		}
233
234
		return buildProposal(
235
			query,
236
			choice,
237
			choice,
238
			identifierImage(role, realFunction),
239
			position,
240
			offset,
241
			cursorOffset
242
		);
243
	}
244
245
	private ICompletionProposal buildPropertyProposal(String query, String choice, int position, int offset) {
246
		return buildProposal(query, choice, choice, mappingImage(choice), position, offset);
247
	}
248
249
	private ICompletionProposal buildProposal(String query,
250
	                                          String choice,
251
	                                          String displayString,
252
	                                          Image image,
253
	                                          int position,
254
	                                          int offset) {
255
256
		return buildProposal(query, choice, displayString, image, position, offset, 0);
257
	}
258
259
	private ICompletionProposal buildProposal(String query,
260
	                                          String choice,
261
	                                          String displayString,
262
	                                          Image image,
263
	                                          int position,
264
	                                          int offset,
265
	                                          int cursorOffset) {
266
267
		ResultQuery result = contentAssistItems.buildQuery(
268
			query,
269
			choice,
270
			position,
271
			completionInserts
272
		);
273
274
		return new CompletionProposal(
275
			result.getQuery(),
276
			offset + 1,
277
			query.length(),
278
			result.getPosition(),
279
			image,
280
			displayString,
281
			null,
282
			null
283
		);
284
	}
285
286
	private List<ICompletionProposal> buildProposals(NamedQuery namedQuery,
287
	                                                 String actualQuery,
288
	                                                 int tokenStart,
289
	                                                 int position,
290
	                                                 CompletionContext completionContext) {
291
292
		completionInserts = isCompletionInserts(namedQuery.getJpaProject().getJavaProject());
293
		List<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>();
294
295
		queryHelper = new JpaJpqlQueryHelper(namedQuery, actualQuery);
296
		contentAssistItems = queryHelper.buildContentAssistItems(position);
297
298
		addAbstractSchemaNames    (actualQuery, position, tokenStart, proposals);
299
		addIdentificationVariables(actualQuery, position, tokenStart, proposals);
300
		addIdentifiers            (actualQuery, position, tokenStart, proposals);
301
		addProperties             (actualQuery, position, tokenStart, proposals);
302
303
		return proposals;
304
	}
305
306
	private void checkCanceled(IProgressMonitor monitor) throws InterruptedException {
307
		if (monitor.isCanceled()) {
308
			throw new InterruptedException();
309
		}
310
	}
311
312
	/**
313
	 * {@inheritDoc}
314
	 */
315
	@SuppressWarnings("rawtypes")
316
	public List computeCompletionProposals(ContentAssistInvocationContext context,
317
	                                       IProgressMonitor monitor) {
318
319
		if (context instanceof JavaContentAssistInvocationContext) {
320
			monitor.beginTask(null, 100);
321
			try {
322
				return computeCompletionProposals((JavaContentAssistInvocationContext) context, monitor);
323
			}
324
			catch (Exception e) {
325
				Status status = new Status(IStatus.ERROR, JptJpaCorePlugin.PLUGIN_ID, "Can't retrieve JPQL proposals due to an internal error.", e);
326
				JptJpaCorePlugin.log(status);
327
			}
328
			finally {
329
				monitor.done();
330
			}
331
		}
332
333
		return Collections.emptyList();
334
	}
335
336
	private List<ICompletionProposal> computeCompletionProposals(JavaContentAssistInvocationContext context,
337
	                                                             IProgressMonitor monitor) throws Exception {
338
339
		ICompilationUnit compilationUnit = context.getCompilationUnit();
340
		if (compilationUnit == null) return Collections.emptyList();
341
342
		IFile file = getCorrespondingResource(compilationUnit);
343
		if (file == null) return Collections.emptyList();
344
345
		JpaFile jpaFile = JptJpaCorePlugin.getJpaFile(file);
346
		if (jpaFile == null) return Collections.emptyList();
347
348
		monitor.worked(80);
349
		checkCanceled(monitor);
350
351
		CompletionContext completionContext = context.getCoreContext();
352
353
		// The token "start" is the offset of the token's first character
354
		int tokenStart = completionContext.getTokenStart();
355
356
		// Not sure why this happens - see bug 242286
357
		if (tokenStart == -1) {
358
			return Collections.emptyList();
359
		}
360
361
		CompilationUnit astRoot = ASTTools.buildASTRoot(compilationUnit);
362
363
		for (JpaStructureNode node : jpaFile.getRootStructureNodes()) {
364
			// First find the Named Query node
365
			JavaNamedQuery namedQuery = findNamedQuery(node, astRoot, tokenStart);
366
367
			if (namedQuery != null) {
368
				// Make sure the position within the query (inside the double quotes)
369
				TextRange textRange = namedQuery.getQueryAnnotation().getQueryTextRange(astRoot);
370
				int position = completionContext.getOffset() - textRange.getOffset() - 1;
371
372
				if (position >= 0) {
373
					// Retrieve the actual value of the element "query" since the content assist can be
374
					// invoked before the model received the new content
375
					int tokenEnd = completionContext.getTokenEnd();
376
					String actualQuery = context.getDocument().get(tokenStart + 1, tokenEnd - tokenStart - 1);
377
378
					// Now create the proposals
379
					return buildProposals(namedQuery, actualQuery, tokenStart, position, completionContext);
380
				}
381
			}
382
		}
383
384
		return Collections.emptyList();
385
	}
386
387
	/**
388
	 * {@inheritDoc}
389
	 */
390
	@SuppressWarnings("rawtypes")
391
	public List computeContextInformation(ContentAssistInvocationContext context,
392
	                                      IProgressMonitor monitor) {
393
394
		return Collections.emptyList();
395
	}
396
397
	private JavaNamedQuery findNamedQuery(JpaStructureNode structureNode,
398
	                                      CompilationUnit astRoot,
399
	                                      int tokenStart) {
400
401
		if (structureNode instanceof JavaPersistentType) {
402
			JavaPersistentType persistentType = (JavaPersistentType) structureNode;
403
			JavaTypeMapping typeMapping = persistentType.getMapping();
404
405
			if (typeMapping instanceof JavaEntity) {
406
				JavaEntity entity = (JavaEntity) typeMapping;
407
408
				for (Iterator<JavaNamedQuery> queries = entity.getQueryContainer().namedQueries(); queries.hasNext(); ) {
409
					JavaNamedQuery namedQuery = queries.next();
410
					TextRange textRange = namedQuery.getQueryAnnotation().getQueryTextRange(astRoot);
411
412
					if (textRange.includes(tokenStart)) {
413
						return namedQuery;
414
					}
415
				}
416
			}
417
		}
418
419
		return null;
420
	}
421
422
	private IFile getCorrespondingResource(ICompilationUnit compilationUnit) {
423
		try {
424
			return (IFile) compilationUnit.getCorrespondingResource();
425
		}
426
		catch (JavaModelException ex) {
427
			JptJpaCorePlugin.log(ex);
428
			return null;
429
		}
430
	}
431
432
	/**
433
	 * {@inheritDoc}
434
	 */
435
	public String getErrorMessage() {
436
		return null;
437
	}
438
439
	private Image getImage(String key) {
440
		ImageRegistry imageRegistry = getImageRegistry();
441
		Image image = imageRegistry.get(key);
442
		if (image == null) {
443
			imageRegistry.put(key, getImageDescriptor(key));
444
			image = imageRegistry.get(key);
445
		}
446
		return image;
447
	}
448
449
	private ImageDescriptor getImageDescriptor(String key) {
450
		return JptJpaUiPlugin.getImageDescriptor(key);
451
	}
452
453
	private ImageRegistry getImageRegistry() {
454
		if (imageRegistry == null) {
455
			imageRegistry = new ImageRegistry(Display.getCurrent());
456
		}
457
		return imageRegistry;
458
	}
459
460
	private Image identificationVariableImage() {
461
		return getImage(JptUiIcons.JPQL_VARIABLE);
462
	}
463
464
	@SuppressWarnings("fallthrough")
465
	private Image identifierImage(IdentifierRole role, boolean realFunction) {
466
467
		if (role != null) {
468
			switch (role) {
469
				case FUNCTION: {
470
					if (realFunction) {
471
						return getImage(JptUiIcons.JPQL_FUNCTION);
472
					}
473
				}
474
				default: {
475
					return getImage(JptUiIcons.JPQL_IDENTIFIER);
476
				}
477
			}
478
		}
479
480
		return null;
481
	}
482
483
	private boolean isCompletionInserts(IJavaProject javaProject) {
484
		String value = PreferenceConstants.getPreference(PreferenceConstants.CODEASSIST_INSERT_COMPLETION, javaProject);
485
		return Boolean.valueOf(value);
486
	}
487
488
	private boolean isRealFunction(String identifier) {
489
		return identifier != Expression.TRUE         &&
490
		       identifier != Expression.FALSE        &&
491
		       identifier != Expression.NULL         &&
492
		       identifier != Expression.CURRENT_DATE &&
493
		       identifier != Expression.CURRENT_TIME &&
494
		       identifier != Expression.CURRENT_TIMESTAMP;
495
	}
496
497
	private Image mappingImage(String propertyName) {
498
		switch (contentAssistItems.getMappingType(propertyName)) {
499
			case BASIC:               return getImage(JptUiIcons.BASIC);
500
			case BASIC_COLLECTION:    return getImage(JptUiIcons.ELEMENT_COLLECTION);
501
			case BASIC_MAP:           return getImage(JptUiIcons.ELEMENT_COLLECTION);
502
			case ELEMENT_COLLECTION:  return getImage(JptUiIcons.ELEMENT_COLLECTION);
503
			case EMBEDDED:            return getImage(JptUiIcons.EMBEDDED);
504
			case EMBEDDED_ID:         return getImage(JptUiIcons.EMBEDDED_ID);
505
			case ID:                  return getImage(JptUiIcons.ID);
506
			case MANY_TO_MANY:        return getImage(JptUiIcons.MANY_TO_MANY);
507
			case MANY_TO_ONE:         return getImage(JptUiIcons.MANY_TO_ONE);
508
			case ONE_TO_MANY:         return getImage(JptUiIcons.ONE_TO_MANY);
509
			case ONE_TO_ONE:          return getImage(JptUiIcons.ONE_TO_ONE);
510
			case TRANSFORMATION:      return getImage(JptUiIcons.TRANSIENT);  // TODO
511
			case VARIABLE_ONE_TO_ONE: return getImage(JptUiIcons.ONE_TO_ONE); // TODO
512
			case VERSION:             return getImage(JptUiIcons.VERSION);
513
			default:                  return getImage(JptUiIcons.TRANSIENT);
514
		}
515
	}
516
517
	/**
518
	 * {@inheritDoc}
519
	 */
520
	public void sessionEnded() {
521
522
		queryHelper = null;
523
		contentAssistItems = null;
524
525
		if (imageRegistry != null) {
526
			imageRegistry.dispose();
527
		}
528
	}
529
530
	/**
531
	 * {@inheritDoc}
532
	 */
533
	public void sessionStarted() {
534
		// Nothing to do
535
	}
536
537
	private class ManagedTypeVisitor implements IManagedTypeVisitor {
538
539
		/**
540
		 * The key used to retrieve the image representing the managed type.
541
		 */
542
		String imageKey;
543
544
		/**
545
		 * {@inheritDoc}
546
		 */
547
		public void visit(IEmbeddable embeddable) {
548
			imageKey = JptUiIcons.EMBEDDABLE;
549
		}
550
551
		/**
552
		 * {@inheritDoc}
553
		 */
554
		public void visit(IEntity entity) {
555
			imageKey = JptUiIcons.ENTITY;
556
		}
557
558
		/**
559
		 * {@inheritDoc}
560
		 */
561
		public void visit(IMappedSuperclass mappedSuperclass) {
562
			imageKey = JptUiIcons.MAPPED_SUPERCLASS;
563
		}
564
	}
565
}

Return to bug 337930