会员
周边
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
hibernate3例子
博客园
首页
新随笔
联系
订阅
管理
Java 泛型List clone
public static <T> List<T> copy(List<T> source) throws IllegalAccessException, InvocationTargetException, InstantiationException, NoSuchMethodException { //clone后的集合 List<T> temp=new ArrayList<T>(); for(T t:source){ //T temporary=(T) source.getClass().newInstance(); //BeanUtils.copyProperties(temporary,t);//Spring BeanUtils or Apache Commons T temporary=(T) BeanUtils.cloneBean(t); temp.add(temporary); } return temp; }
posted @
2012-05-05 09:58
hibernate3例子
阅读(
245
) 评论(
0
)
收藏
举报
刷新页面
返回顶部
公告