一些知识点

1、mybatis对应的实体类要有一个无参数的构造函数否则会报如下错误.

Error instantiating class com.xx.QueryUserResp with invalid types (DUser) or values (6). Cause: java.lang.IllegalArgumentException: argument type mismatch

2、注解

  • myBatis中mapper对应的dao要有@Mapper注解,如果该dao在idea中有红线,再增加@Repostory注解。
  • Service的实现类要有@Service注解。此时默认的service 名称为该serive的首字母小写类名。
  • 当一个接口有两个实现类时,如何调用呢
@Resource(name="imgDataDao")                             

private DataDao xx;

或者:

@Autowired

@Qualifier("imgDataDao")

private DataDao yy;

  • @Bean注解的作用
  • @Param("classifyIds")
List<Goods> queryListByClassifyIds(@Param("classifyIds") List<Integer> classifyIds);

<select id="queryListByClassifyIds" resultMap="baseResultMap" parameterType="com.xx.sku.goods.entity.Goods">
        select
        <include refid="baseColumnList"/>
        from d_goods
        where cid in
        <foreach collection="classifyIds" item="cid" index="index" open="(" close=")" separator=",">
            #{cid}
        </foreach>
    </select>

3、工具类

  • DateFormatUtils
Date date = new Date();
System.out.println(DateFormatUtils.format(date, "yyyy-MM-dd HH:mm:ss"));
  • BeanUtils
  • MessageFormat \ String.format

4、框架

  • Ehcache

5、 SpringBoot-行锁 百度学习下

6、redis缓存击穿

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。