随笔分类 -  踩过的坑

摘要:一句话概括:范性用于做类型检测,类型校验。 反面教材: public <T, S, M> Object function(String a, String b, T t); 上例中范型T, S, M仅T在参数列表中,且T与返回值无任何关系(故无法起到约束作用)。S, M压根在参数列表和返回值中无任何 阅读全文
posted @ 2021-09-27 22:25 机械公敌 阅读(162) 评论(0) 推荐(0)
摘要:https://blog.csdn.net/u013399093/article/details/53087469 阅读全文
posted @ 2021-04-22 18:09 机械公敌 阅读(68) 评论(0) 推荐(0)
摘要:https://segmentfault.com/a/1190000006577082 问题定位:该问题通常出现在动态sql中,使用String与char类型做比较。如: <if test="segment != null and segment != '' and segment == '1'"> 阅读全文
posted @ 2021-03-29 11:47 机械公敌 阅读(699) 评论(0) 推荐(0)
摘要:ArrayList<String> list=new ArrayList<String>(); String strings[]=(String [])list.toArray(); 这样写编译没有什么问题,但是运行时会报ClassCastException,这是因为Java中允许向上和向下转型,但 阅读全文
posted @ 2021-03-25 21:46 机械公敌 阅读(65) 评论(0) 推荐(0)
摘要:(select * from table1) 错误,语法不对,()会当作一张表或一个字段(case when)来处理。 阅读全文
posted @ 2021-03-16 17:55 机械公敌 阅读(20) 评论(0) 推荐(0)
摘要:T serviceClass=xxx.Class.newInstance(); Method xxxMethod = serviceClass.getMethod(methodName, requestClass); Object xxx = xxxMethod.invoke(serviceInst 阅读全文
posted @ 2021-01-22 11:26 机械公敌 阅读(105) 评论(0) 推荐(0)
摘要:场景描述: 我们在用Spring框架开发Web项目过程中,经常需要用同一个service中的一个方法调用另一个方法,如果此时调用方没有添加事务注解@Transactional,而在被调用方添加事务注解@Transactional,当被调用方法中出现异常,这时候会发现事务并没有回滚,事务注解@Tran 阅读全文
posted @ 2021-01-13 19:07 机械公敌 阅读(521) 评论(0) 推荐(0)
摘要:踩过的坑: 对于快照版本,SNAPSHOT必须大写,如果小写snapshot,maven会认为其是releases版本。 阅读全文
posted @ 2021-01-04 19:17 机械公敌 阅读(834) 评论(0) 推荐(0)
摘要:Consider the following: If you want an embedded database (H2, HSQL or Derby), please put it on the classpath. If you have database settings to be load 阅读全文
posted @ 2020-08-07 12:58 机械公敌 阅读(269) 评论(0) 推荐(0)