From d0150295578b823f5cac2d97a27422be26ca6583 Mon Sep 17 00:00:00 2001 From: Imran M Yousuf Date: Wed, 1 Jul 2009 08:48:54 +0700 Subject: [PATCH] Add @Name support for methods and fields Signed-off-by: Imran M Yousuf --- .../exim/impl/DefaultAnnotationConfigScanner.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/smart-exim/smart-exim-api/src/main/java/com/smartitengineering/exim/impl/DefaultAnnotationConfigScanner.java b/smart-exim/smart-exim-api/src/main/java/com/smartitengineering/exim/impl/DefaultAnnotationConfigScanner.java index 7a52715..beceb93 100644 --- a/smart-exim/smart-exim-api/src/main/java/com/smartitengineering/exim/impl/DefaultAnnotationConfigScanner.java +++ b/smart-exim/smart-exim-api/src/main/java/com/smartitengineering/exim/impl/DefaultAnnotationConfigScanner.java @@ -437,12 +437,16 @@ public class DefaultAnnotationConfigScanner resourceConfig == null) { throw new IllegalArgumentException(); } - Export annotation = - element.getAnnotation(Export.class); AssociationConfigImpl configImpl = new AssociationConfigImpl(); configImpl.setAccessorName(accessorName); - configImpl.setName(propertyName); + Name nameAnnotation = element.getAnnotation(Name.class); + if (nameAnnotation != null) { + configImpl.setName(nameAnnotation.value()); + } + else { + configImpl.setName(propertyName); + } configImpl.setAssociationType(AssociationConfig.AssociationType. getAssociationType(propertyType)); Eager eager = @@ -450,6 +454,8 @@ public class DefaultAnnotationConfigScanner configImpl.setStringProviderImplemented(StringValueProvider.class. isAssignableFrom(propertyType)); configImpl.setEagerSet(eager != null); + Export annotation = + element.getAnnotation(Export.class); if (annotation != null) { configImpl.setItToBeExportedAsUri(!annotation.asObject()); configImpl.setTransient(annotation.isTransient()); -- 2.11.4.GIT