From 7d6b6d88127ae323387f2c462c23067d4a671406 Mon Sep 17 00:00:00 2001 From: Imran M Yousuf Date: Tue, 30 Jun 2009 09:54:42 +0700 Subject: [PATCH] Fix the behavior of Id of a domain Previously if ID was not specified properly it was being ignored, but this fix ensures that any config without properly mentioned ID will not be registered. Previously ID's prefix was not being set to the config, but this change ensures that it is being set. Signed-off-by: Imran M Yousuf --- .../exim/impl/DefaultAnnotationConfigScanner.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 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 0fcf042..886b00a 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 @@ -213,8 +213,16 @@ public class DefaultAnnotationConfigScanner resourceConfig.setPriority(domainAnnotation.priority()); scanMembers(resourceConfig, probableResourceClass); scannedClasses.add(probableResourceClass); - configuraitons.put(probableResourceClass, resourceConfig); - return resourceConfig; + //If domain id is not specified then its not a valid domain + if (!resourceConfig.isIdentityCustomizerImplemented() && + (resourceConfig.getIdPropertyName() == null || resourceConfig. + getIdPropertyName().equals(""))) { + return null; + } + else { + configuraitons.put(probableResourceClass, resourceConfig); + return resourceConfig; + } } /** @@ -406,6 +414,7 @@ public class DefaultAnnotationConfigScanner element.getAnnotation(Id.class); if (id != null) { resourceConfig.setIdPropertyName(propertyName); + resourceConfig.setIdPrefix(id.path()); } } -- 2.11.4.GIT