mysql jdbc 5.1.47中nullNamePatternMatchesAll默认为true
mysql jdbc 6.0.6或更高版本中nullNamePatternMatchesAll默认为false
所以在设置mysql连接uri时
mysql jdbc 6以上版本(包含6)在uri后增加nullNamePatternMatchesAll=true即可
jdbc:mysql://127.0.0.1:3306/xxxx?characterEncoding=utf-8&nullNamePatternMatchesAll=true&useSSL=false&serverTimezone=UTC&autoReconnect=true&failOverReadOnly=false&maxReconnects=10
否则在生成model代码时DatabaseMetaData会抛出tableNamePattern is not null or empty..具体如下图: