List<AbstractBlogVO> list = (List<AbstractBlogVO>) dataMap.get("blogVOList");
if(list!=null){
for(int i=0;i<list.size();i++){
// if("activity".equals(list.get(i).getType())){
// list.get(i).setBlogActivityVO(blogActivityJpaRepo.findByBlogId(list.get(i).getId()));
// }
String setMethodName = "setBlog" + list.get(i).getType().substring(0, 1).toUpperCase()
+ list.get(i).getType().substring(1) + "VO";
String japFieldName = "blog" + list.get(i).getType().substring(0, 1).toUpperCase()
+ list.get(i).getType().substring(1) + "JpaRepo";
try {
Object o = this.getClass().getDeclaredField(japFieldName).getType()
.getMethod("findByBlogId", list.get(i).getId().getClass())
.invoke(this.getClass().getDeclaredField(japFieldName).get(this), list.get(i).getId());
if(o != null)
AbstractBlogVO.class.getMethod(setMethodName,o.getClass()).invoke(list.get(i), o);
} catch (NoSuchFieldException e) {
continue;
}
}
}
System.out.println(list);