{"action":"created","issue":{"url":"https://api.github.com/repos/javalite/activejdbc/issues/381","repository_url":"https://api.github.com/repos/javalite/activejdbc","labels_url":"https://api.github.com/repos/javalite/activejdbc/issues/381/labels{/name}","comments_url":"https://api.github.com/repos/javalite/activejdbc/issues/381/comments","events_url":"https://api.github.com/repos/javalite/activejdbc/issues/381/events","html_url":"https://github.com/javalite/activejdbc/issues/381","id":60348415,"number":381,"title":"Suggestion: Make Model.update() generate update statement only with changed data","user":{"login":"Garagoth","id":916161,"avatar_url":"https://avatars.githubusercontent.com/u/916161?v=3","gravatar_id":"","url":"https://api.github.com/users/Garagoth","html_url":"https://github.com/Garagoth","followers_url":"https://api.github.com/users/Garagoth/followers","following_url":"https://api.github.com/users/Garagoth/following{/other_user}","gists_url":"https://api.github.com/users/Garagoth/gists{/gist_id}","starred_url":"https://api.github.com/users/Garagoth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Garagoth/subscriptions","organizations_url":"https://api.github.com/users/Garagoth/orgs","repos_url":"https://api.github.com/users/Garagoth/repos","events_url":"https://api.github.com/users/Garagoth/events{/privacy}","received_events_url":"https://api.github.com/users/Garagoth/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":29,"created_at":"2015-03-09T14:12:20Z","updated_at":"2016-11-22T01:01:04Z","closed_at":"2015-03-25T05:21:54Z","body":"When changing one field in a model of a table that has ~100 columns sending and update with all data causes unnecessary network traffic (especially when some of that fields are blobs or long strings) and makes reading logs very hard - it is not known what was changed.\nTracking field changes would solve above problems.\n\nThis change will also make #364 much easier to implement in future.\n\nRegards,\nMarcin.\n"},"comment":{"url":"https://api.github.com/repos/javalite/activejdbc/issues/comments/262116597","html_url":"https://github.com/javalite/activejdbc/issues/381#issuecomment-262116597","issue_url":"https://api.github.com/repos/javalite/activejdbc/issues/381","id":262116597,"user":{"login":"codezion","id":9550391,"avatar_url":"https://avatars.githubusercontent.com/u/9550391?v=3","gravatar_id":"","url":"https://api.github.com/users/codezion","html_url":"https://github.com/codezion","followers_url":"https://api.github.com/users/codezion/followers","following_url":"https://api.github.com/users/codezion/following{/other_user}","gists_url":"https://api.github.com/users/codezion/gists{/gist_id}","starred_url":"https://api.github.com/users/codezion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codezion/subscriptions","organizations_url":"https://api.github.com/users/codezion/orgs","repos_url":"https://api.github.com/users/codezion/repos","events_url":"https://api.github.com/users/codezion/events{/privacy}","received_events_url":"https://api.github.com/users/codezion/received_events","type":"User","site_admin":false},"created_at":"2016-11-22T01:01:04Z","updated_at":"2016-11-22T01:01:04Z","body":"I like to keep the current way also, but just thinking how get rid of extra writing if there really is no changes. Setting values through this function seems to do the trick, so maybe something like it could be added to the Model as alternative way:\r\n`public void setIfModified(Model model, String key, Object value)\r\n  {\r\n    if(model.get(key) == null || !model.get(key).equals(value))\r\n    {\r\n      model.set(key, value);\r\n    }\r\n  }` "}}
{"actor":{"display_login":"codezion"}}