具体区别Google上提及的已经比较全面,以下记录自己在开发中对这两个方法的使用心得:
setCurrentRowWithKeyValue用于vo只有一个主键时
例如:userIt(Iterator)只有用户id作为主键时
userIt.setCurrentRowWithKeyValue(userId);
setCurrentRowWithKey用于vo具有多个主键时
例如:userIt(Iterator)有用户id和当前语言同时作为主键时
Object[] key = new Object[2];
key[0] = userId;
key[1] = currentLanguage;
userIt.setCurrentRowWithKey(new Key(key).toStringFormat(true));