List循环遍历从0开始,遍历出来封装成一个对象,然后在对象里取值。
documentIdList = documentTypeService.getDocumentTypeByParentAndName(name, parent);
for (int i=0; i<documentIdList.size(); i++) {
DocumentType document = (DocumentType) documentIdList.get(i);
}
将每次循环的值都封装在一个document对象里,然后取值就行。
取值方法:document.getId();取document对象里的Id值。