上一页 1 2 3 4 5 6 7 8 ··· 18 下一页
摘要: import com.fasterxml.jackson.databind.ObjectMapper; //转成companyEntity CompanyEntity company = mapper.convertValue(redisHandle.get(key), new TypeReference() { }); 阅读全文
posted @ 2019-05-16 15:45 huanghaunghui 阅读(1336) 评论(0) 推荐(0) 编辑
摘要: 相同的一段代码: 所以,在平时编码的时候,尽量把需要比对的不为空的放在equal前面,比如判断 i 是否等于 1,那么使用 1.equals(i) 更为合适,在equals源码中 传入的是object作为比较,null也为一个object,会使用null与现值作比较。 但是使用现对象调用equals 阅读全文
posted @ 2019-05-15 15:55 huanghaunghui 阅读(526) 评论(0) 推荐(0) 编辑
摘要: https://blog.csdn.net/hfsaini/article/details/86477371 阅读全文
posted @ 2019-05-15 14:09 huanghaunghui 阅读(10045) 评论(0) 推荐(0) 编辑
摘要: 导入依赖,让springboot支持@ConfigurationProperties 注解 配置文件: 配置文件注册类: 使用时直接注入即可: 阅读全文
posted @ 2019-04-23 22:38 huanghaunghui 阅读(2947) 评论(0) 推荐(0) 编辑
摘要: 在MySQL中删除一张表或一条数据的时候,出现有外键约束的问题,于是就去查了下方法: 删除数据的时候如果想把id序列也清空到1开始可以: truncate table 表名; 如果不需要清空序列直接删除就好了。 阅读全文
posted @ 2019-04-01 09:57 huanghaunghui 阅读(2996) 评论(0) 推荐(1) 编辑
摘要: 在做大屏系统的时候,遇到十分奇怪的问题,同样的代码,测试环境插入与更新操作正常,但是上了生产环境之后,插入与更新不生效, 插入数据的时候,主键会自增,但是查询表中没有数据,同样一个@Transactional包裹下的方法中,有一个Mapper的insert方法可以被提交,但是两条 数据只插入了一条, 阅读全文
posted @ 2019-03-28 16:57 huanghaunghui 阅读(306) 评论(0) 推荐(0) 编辑
摘要: @GetMapping(value = "/hello/{id}")//需要获取Url=localhost:8080/hello/id中的id值 public String sayHello(@PathVariable("id") Integer id){ return "id:"+id; } @GetMapping(value="/hello/{... 阅读全文
posted @ 2019-03-27 16:57 huanghaunghui 阅读(191) 评论(0) 推荐(0) 编辑
摘要: public static int getLength(String text) { // Java 8 return Optional.ofNullable(text).map(String::length).orElse(-1); // Pre-Java 8 // return if (text != null) ? text.... 阅读全文
posted @ 2019-03-22 15:44 huanghaunghui 阅读(14501) 评论(0) 推荐(0) 编辑
摘要: 1. 进入 DOS窗口 2. 在进入redis的安装目录 3. 输入:redis-server --service-install redis.windows.conf --loglevel verbose ( 安装redis服务 ) 4. 输入:redis-server --service-sta 阅读全文
posted @ 2019-03-10 22:31 huanghaunghui 阅读(2874) 评论(0) 推荐(0) 编辑
摘要: 通过反射,动态修改注解的某个属性值 : https://segmentfault.com/a/1190000011213222 java 注解详解 :https://blog.csdn.net/lylwo317/article/details/52163304 阅读全文
posted @ 2019-02-28 13:24 huanghaunghui 阅读(1908) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 18 下一页