{"action":"created","issue":{"url":"https://api.github.com/repos/baomidou/mybatis-plus/issues/493","repository_url":"https://api.github.com/repos/baomidou/mybatis-plus","labels_url":"https://api.github.com/repos/baomidou/mybatis-plus/issues/493/labels{/name}","comments_url":"https://api.github.com/repos/baomidou/mybatis-plus/issues/493/comments","events_url":"https://api.github.com/repos/baomidou/mybatis-plus/issues/493/events","html_url":"https://github.com/baomidou/mybatis-plus/issues/493","id":361114234,"node_id":"MDU6SXNzdWUzNjExMTQyMzQ=","number":493,"title":"TableField FieldStrategy yml全局配置无效","user":{"login":"251795891","id":17612877,"node_id":"MDQ6VXNlcjE3NjEyODc3","avatar_url":"https://avatars2.githubusercontent.com/u/17612877?v=4","gravatar_id":"","url":"https://api.github.com/users/251795891","html_url":"https://github.com/251795891","followers_url":"https://api.github.com/users/251795891/followers","following_url":"https://api.github.com/users/251795891/following{/other_user}","gists_url":"https://api.github.com/users/251795891/gists{/gist_id}","starred_url":"https://api.github.com/users/251795891/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/251795891/subscriptions","organizations_url":"https://api.github.com/users/251795891/orgs","repos_url":"https://api.github.com/users/251795891/repos","events_url":"https://api.github.com/users/251795891/events{/privacy}","received_events_url":"https://api.github.com/users/251795891/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-18T02:42:44Z","updated_at":"2018-09-18T03:37:19Z","closed_at":null,"author_association":"NONE","body":"在3.0.2版本中，TableField FieldStrategy 注解全局配置无效\r\n\r\n在TableFieldInfo中发现代码如下：\r\n       /*\r\n         * 优先使用单个字段注解，否则使用全局配置\r\n         */\r\n        if (dbConfig.getFieldStrategy() != tableField.strategy()) {\r\n            this.fieldStrategy = tableField.strategy();\r\n        } else {\r\n            this.fieldStrategy = dbConfig.getFieldStrategy();\r\n        }\r\n \r\nbean中的TableField注解strategy值默认为Not_Null。\r\n\r\n根据条件，不等时，取的是默认的not_null\r\n\r\n当相等时，取哪个都一样。\r\n\r\n所以yml中的配置基本没什么作用。\r\n\r\n问题应该是由TableField的strategy default value引起的。\r\n\r\n我的理解： 如果在bean中没指定strategy ，  则判断 yml是否全局配置过，如果没配置过再默认\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/baomidou/mybatis-plus/issues/comments/422243779","html_url":"https://github.com/baomidou/mybatis-plus/issues/493#issuecomment-422243779","issue_url":"https://api.github.com/repos/baomidou/mybatis-plus/issues/493","id":422243779,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMjI0Mzc3OQ==","user":{"login":"miemieYaho","id":28334419,"node_id":"MDQ6VXNlcjI4MzM0NDE5","avatar_url":"https://avatars1.githubusercontent.com/u/28334419?v=4","gravatar_id":"","url":"https://api.github.com/users/miemieYaho","html_url":"https://github.com/miemieYaho","followers_url":"https://api.github.com/users/miemieYaho/followers","following_url":"https://api.github.com/users/miemieYaho/following{/other_user}","gists_url":"https://api.github.com/users/miemieYaho/gists{/gist_id}","starred_url":"https://api.github.com/users/miemieYaho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miemieYaho/subscriptions","organizations_url":"https://api.github.com/users/miemieYaho/orgs","repos_url":"https://api.github.com/users/miemieYaho/repos","events_url":"https://api.github.com/users/miemieYaho/events{/privacy}","received_events_url":"https://api.github.com/users/miemieYaho/received_events","type":"User","site_admin":false},"created_at":"2018-09-18T03:37:19Z","updated_at":"2018-09-18T03:37:19Z","author_association":"MEMBER","body":"下个版本上修复"}}
{"actor":{"display_login":"miemieYaho"}}