踩过的坑 - wjialian/pzcnet_springCloud GitHub Wiki
更新配置中心上传到github后,还应把本地target/config里的缓存文件给删除
例如,你想myuser使用mypassword从任何主机连接到mysql服务器的话。
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
FLUSH PRIVILEGES;
原因:因为反射取得的方法参数名为arg0/1/2等
解决方法:在idea中Settings-build,execution,deployment-compiler-java compiler->additional command line parameters中填入-parameters。这样编译后才会保留方法的参数名
方法1. 需要在Application启动主类上加@EnableJpaAuditing 方法2. 在BaseConfiguration前加@EnableJpaAuditing且@EntityScan必须扫描到对应的包
原因:在domain文件夹某个类下,假若写了自己自定义的getXXX(); mybatis在解析类属性对应字段时,会使用该方法,导致属性不匹配。
解决办法:在domain文件夹下,任何类的getter、setter 使用mybatisGenerator生成。切记自定义get方法时不重写自动生成的getter。
http://blog.csdn.net/qq_21251983/article/details/52849079
mybatis-generator生成xml时,如果不清空会append数据,导致数据重复,要手动删除先
componentScan中的路径只能到文件夹,后面不能再加*
在requestMapping中的路径前加上"/",如原本要请求user,改为"/user"
增加identity="true",生成的XXXmapper.xml中的insert的order="AFTER"。 先插入数据,再取得数据的id
<table tableName="restaurant_info" domainObjectName="RestaurantInfo">
<property name="useActualColumnNames" value="true"/>
<generatedKey column="id" sqlStatement="Mysql" identity="true"/>
</table>
获得方法如下:
mapper.insert(model);
id = model.getId();
更改redis.conf中的bind ${ip}-> bind 0.0.0.0,才允许远程访问