Role保存Menu
来源:互联网 发布:神仙劫翅膀进阶数据 编辑:程序博客网 时间:2024/05/15 10:41
BeanMapUtils下的两个方法:
/*使用递归*/public static AuthMenu copy(AuthMenuPO po,String... ignore){ AuthMenu am = new AuthMenu(); List<AuthMenu> children = new ArrayList<AuthMenu>(); BeanUtils.copyProperties(po, am,"parent","children"); List<String> ignoreList = Arrays.asList(ignore); if(po.getParent()!=null && !ignoreList.contains("parent")){ am.setParent(BeanMapUtils.copy(po.getParent())); }for(AuthMenuPO child :po.getChildren()){ AuthMenu childAuthMenu = BeanMapUtils.copy(child,"parent"); childAuthMenu.setParent(am); children.add(childAuthMenu); } am.setChildren(children); return am; }
public static Role copy(RolePO po){ Role r = new Role(); BeanUtils.copyProperties(po, r,"users","authMenus"); List<AuthMenu> authMenus = new ArrayList<AuthMenu>(); for(AuthMenuPO authMenuPO : po.getAuthMenus()){ AuthMenu authMenu = BeanMapUtils.copy(authMenuPO); authMenus.add(authMenu); } r.setAuthMenus(authMenus); return r; }
1 0
- Role保存Menu
- Use sitemap and role management control the navigation menu
- role
- Role
- role
- Menu
- Menu
- menu
- menu
- menu
- Menu
- MENU
- menu
- menu
- Menu
- Menu
- menu
- menu
- DSA与RSA的区别
- iOS:hidesBottomBarWhenPushed的正确用法
- 教父经典语录
- IOS之同步请求、异步请求、GET请求、POST请求
- Windows7和Ubuntu15.04互相远程控制(在相同内网)
- Role保存Menu
- android部分目录分析
- oracle课堂收录-函数举例
- Hihocoder #1095 : HIHO Drinking Game (微软笔试题)
- ZwCreateFile打开文件时出现SHARE_VIOLATION的问题的一种情况
- Android JNI实现计算器demo
- iOS富文本(一)属性化字符串
- iOS target
- 音频编码之opus(一)