|
59 | 59 | import net.harawata.mybatipse.mybatis.JavaMapperUtil.ResultsAnnotationWithId; |
60 | 60 | import net.harawata.mybatipse.mybatis.MapperNamespaceCache; |
61 | 61 | import net.harawata.mybatipse.mybatis.MybatipseXmlUtil; |
| 62 | +import net.harawata.mybatipse.util.NameUtil; |
62 | 63 | import net.harawata.mybatipse.util.XpathUtil; |
63 | 64 |
|
64 | 65 | /** |
@@ -279,33 +280,33 @@ private void parseResults(Annotation anno) |
279 | 280 | } |
280 | 281 | for (Expression resultAnno : resultAnnos) |
281 | 282 | { |
282 | | - if (isInRange(resultAnno, offset)) |
| 283 | + if (!isInRange(resultAnno, offset)) |
| 284 | + continue; |
| 285 | + createHyperlink("select", |
| 286 | + expressionAt(annotationValueAt((Annotation)annotationValueAt((Annotation)resultAnno, |
| 287 | + Arrays.asList("one", "many"), offset), "select", offset), offset)); |
| 288 | + if (hyperlink == null) |
283 | 289 | { |
284 | | - createHyperlink("select", |
285 | | - expressionAt(annotationValueAt((Annotation)annotationValueAt((Annotation)resultAnno, |
286 | | - Arrays.asList("one", "many"), offset), "select", offset), offset)); |
287 | | - if (hyperlink == null) |
| 290 | + Expression propertyName = annotationValueAt((Annotation)resultAnno, "property", |
| 291 | + offset); |
| 292 | + if (propertyName == null) |
| 293 | + return; |
| 294 | + String returnType = method.resolveBinding().getReturnType().getQualifiedName(); |
| 295 | + if (returnType == null || "void".equals(returnType)) |
| 296 | + return; |
| 297 | + try |
288 | 298 | { |
289 | | - Expression propertyName = annotationValueAt((Annotation)resultAnno, "property", |
290 | | - offset); |
291 | | - if (propertyName == null) |
292 | | - return; |
293 | | - String returnType = method.resolveBinding().getReturnType().getQualifiedName(); |
294 | | - if (returnType == null || "void".equals(returnType)) |
295 | | - return; |
296 | | - try |
297 | | - { |
298 | | - hyperlink = linkToJavaProperty(project, returnType, |
299 | | - (String)propertyName.resolveConstantExpressionValue(), |
300 | | - new Region(propertyName.getStartPosition(), propertyName.getLength())); |
301 | | - } |
302 | | - catch (JavaModelException e) |
303 | | - { |
304 | | - Activator.log(Status.ERROR, e.getMessage(), e); |
305 | | - } |
| 299 | + hyperlink = linkToJavaProperty(project, |
| 300 | + NameUtil.manageableReturnType(project, returnType), |
| 301 | + (String)propertyName.resolveConstantExpressionValue(), |
| 302 | + new Region(propertyName.getStartPosition(), propertyName.getLength())); |
| 303 | + } |
| 304 | + catch (JavaModelException e) |
| 305 | + { |
| 306 | + Activator.log(Status.ERROR, e.getMessage(), e); |
306 | 307 | } |
307 | | - break; |
308 | 308 | } |
| 309 | + break; |
309 | 310 | } |
310 | 311 | } |
311 | 312 |
|
|
0 commit comments