利用BeanUtils.copyProperties 克隆出新对象,避免对象重复问题

1、经常用jQuery获取标签里面值val(),或者html(),text()等等,有次想把获取标签的全部html元素包括自己也用来操作,查询了半天发现$("#lefttr1").prop("outerHTML")即可。

2、当时遇到这个错误,后发现是缺少主键错误。

 

3、JsonMappingException: No suitable constructor found ,reate the default constructor for your POJO class

这两种报错都有可能是没有创建构造函数原因。

4、java.lang.OutOfMemoryError: PermGen spac内存不足通过百度内存不足解决

5、could not load an entity有可能是数据库和实体对应的字段不一致

6、今天遇到File.separator 不明白什么意思,一查得知是系统有关的分隔符,'/'相关详情为http://blog.csdn.net/chindroid/article/details/7735832其中包含其他系统有关字段。

7、

ObjectMapper obj= new ObjectMapper();

jsonString=obj.writeValueAsString(customerAuthWithCustomerReq); 这样可以把集合列表转换成json。

8、iframe页面中parent.funA可以调用父页面方法。

9、BeanUtils.copyProperties(productInstQueryForm, req);可以复制一个类到另一个类,减少各种set,,这个问题遇到多次了,

public static void main(String[] args) {
            List<AccAccountBalanceInterest> newAccAccountBalanceInterestList = new ArrayList<AccAccountBalanceInterest>();
            AccAccountBalanceInterest bbb=new AccAccountBalanceInterest(); 
            bbb.setId("111");
            bbb.setInterestAmount(new BigDecimal("0"));
            for(int i=0;i<3;i++){
                AccAccountBalanceInterest aaa=new AccAccountBalanceInterest();
                aaa=bbb;
                aaa.setInterestAmount(new BigDecimal(i));
                newAccAccountBalanceInterestList.add(aaa);
            }
            for(int i=0;i<3;i++){
                System.out.println(newAccAccountBalanceInterestList.get(i).getInterestAmount());
            }

list循环发现 都是同一个对象。最后用BeanUtils.copyProperties解决

 10、开发中,当想删除数据库后再新增的时候,需要考虑下删除的时候,同时其他是否有操作。对该功能的影响

11、windows软连接功能。记录一下

12、grep -n "DC864180719A31700219" catalina.out  直接查日志中包含该字段。

13、  list或者map转换成json的时候,空值的时候,字段会变没有,展现出来的是未定义 解决办法JSONObject jsonObject = JSONObject.fromObject(map);

转载于:https://www.cnblogs.com/minzhousblogs/p/5369183.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值