|
From: Irina Z. <i_z...@us...> - 2004-04-21 14:06:45
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/user In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32750/src/org/cobricks/user Modified Files: UserManagerImpl.java Log Message: updateUser(user) Index: UserManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/user/UserManagerImpl.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- UserManagerImpl.java 21 Apr 2004 13:36:33 -0000 1.9 +++ UserManagerImpl.java 21 Apr 2004 14:05:55 -0000 1.10 @@ -46,6 +46,7 @@ import org.cobricks.user.attribute.AttributeDescriptor; import org.cobricks.user.attribute.AttributeDescriptorManager; import org.cobricks.user.attribute.UserJoin; + import org.globus.test.otherTypes.OtherType; import org.omg.PortableInterceptor.USER_EXCEPTION; @@ -1265,6 +1266,7 @@ Map attrsOld = new HashMap(); Map toDelete = new HashMap(); attrsNew = user.getAttributes(); + AttributeDescriptor attributeDescriptor = null; int userid = user.getId(); @@ -1293,25 +1295,35 @@ } catch (CobricksException cE) { logger.error("ERROR in updateUser(user) ", cE); } + Map userMainAttrsToDelete = new HashMap(); Map otherTableAttrsToDelete = new HashMap(); + for (Iterator i = toDelete.entrySet().iterator(); i.hasNext();) { - Map.Entry attrToDelete = (Map.Entry) i.next(); + Map.Entry attrToDelete = (Map.Entry)i.next(); String aname = (String)attrToDelete.getKey(); - try{ - attributeDescriptor = getAttributeDescriptorManager(userclass).getAttributeDescriptorFor(aname); - }catch (Exception e){} - if (attributeDescriptor.getTableName().equalsIgnoreCase(TABLE_USER_MAIN)){ - userMainAttrsToDelete.put(aname, attrToDelete.getValue()); + + try { + attributeDescriptor = getAttributeDescriptorManager(userclass) + .getAttributeDescriptorFor(aname); + } catch (Exception e) { } - else{ + + if (attributeDescriptor.getTableName().equalsIgnoreCase(TABLE_USER_MAIN)) { + userMainAttrsToDelete.put(aname, attrToDelete.getValue()); + } else { otherTableAttrsToDelete.clear(); - otherTableAttrsToDelete.put(User.USERID, new Integer(userid)); - otherTableAttrsToDelete.put(attributeDescriptor.getConditionFieldName(), aname); - dbAccess.sqlDelete(attributeDescriptor.getTableName(), otherTableAttrsToDelete); + otherTableAttrsToDelete.put(User.USERID, + new Integer(userid)); + otherTableAttrsToDelete.put(attributeDescriptor + .getConditionFieldName(), aname); + dbAccess.sqlDelete(attributeDescriptor.getTableName(), + otherTableAttrsToDelete); } - } + //user_main handle + //for + } } |