@@ -473,58 +473,61 @@ public static void setupParameters(BaseCmd cmd, Map<String, String> params, List
473473 //for maps, specify access to be checkd on key or value.
474474
475475 if (parameterAnnotation .resourceType () != null ){
476- Class <?>[] entity = parameterAnnotation .resourceType ();
477-
478- if (ControlledEntity .class .isAssignableFrom (entity )){
479- if (s_logger .isDebugEnabled ()) {
480- s_logger .debug ("entity name is:" + entity .getName ());
481- }
482-
483- if (s_instance ._daoNameMap .containsKey (entity .getName ())){
484- Class <? extends GenericDao > daoClass = s_instance ._daoNameMap .get (entity .getName ());
485- GenericDao daoClassInstance = s_instance ._locator .getDao (daoClass );
486-
487- //Check if the parameter type is a single Id or list of id's/name's
488- switch (fieldType ) {
489- case LIST :
490- CommandType listType = parameterAnnotation .collectionType ();
491- switch (listType ) {
492- case LONG :
493- List <Long > listParam = new ArrayList <Long >();
494- listParam = (List )field .get (cmd );
495-
496- for (Long entityId : listParam ){
497- ControlledEntity entityObj = (ControlledEntity )daoClassInstance .findById (entityId );
498- entitiesToAccess .add (entityObj );
499- }
500- break ;
501- /*case STRING:
502- List<String> listParam = new ArrayList<String>();
503- listParam = (List)field.get(cmd);
504- for(String entityName: listParam){
505- ControlledEntity entityObj = (ControlledEntity)daoClassInstance(entityId);
506- entitiesToAccess.add(entityObj);
507- }
508- break;
509- */
510- default :
511- break ;
512- }
513- break ;
514- case LONG :
515- Long entityId = (Long )field .get (cmd );
516- ControlledEntity entityObj = (ControlledEntity )daoClassInstance .findById (entityId );
517- entitiesToAccess .add (entityObj );
518- break ;
519- default :
520- break ;
521- }
522-
523-
524- }
525-
526- }
527-
476+ Class <?>[] entityList = parameterAnnotation .resourceType ();
477+ for (Class entity : entityList ){
478+ if (ControlledEntity .class .isAssignableFrom (entity )) {
479+ if (s_logger .isDebugEnabled ()) {
480+ s_logger .debug ("entity name is:" + entity .getName ());
481+ }
482+
483+ if (s_instance ._daoNameMap .containsKey (entity .getName ())) {
484+ Class <? extends GenericDao > daoClass = s_instance ._daoNameMap .get (entity .getName ());
485+ GenericDao daoClassInstance = s_instance ._locator .getDao (daoClass );
486+
487+ // Check if the parameter type is a single
488+ // Id or list of id's/name's
489+ switch (fieldType ) {
490+ case LIST :
491+ CommandType listType = parameterAnnotation .collectionType ();
492+ switch (listType ) {
493+ case LONG :
494+ List <Long > listParam = new ArrayList <Long >();
495+ listParam = (List ) field .get (cmd );
496+
497+ for (Long entityId : listParam ) {
498+ ControlledEntity entityObj = (ControlledEntity ) daoClassInstance .findById (entityId );
499+ entitiesToAccess .add (entityObj );
500+ }
501+ break ;
502+ /*
503+ * case STRING: List<String> listParam =
504+ * new ArrayList<String>(); listParam =
505+ * (List)field.get(cmd); for(String
506+ * entityName: listParam){
507+ * ControlledEntity entityObj =
508+ * (ControlledEntity
509+ * )daoClassInstance(entityId);
510+ * entitiesToAccess.add(entityObj); }
511+ * break;
512+ */
513+ default :
514+ break ;
515+ }
516+ break ;
517+ case LONG :
518+ Long entityId = (Long ) field .get (cmd );
519+ ControlledEntity entityObj = (ControlledEntity ) daoClassInstance .findById (entityId );
520+ entitiesToAccess .add (entityObj );
521+ break ;
522+ default :
523+ break ;
524+ }
525+
526+ }
527+
528+ }
529+ }
530+
528531 }
529532
530533 }
0 commit comments