{"action":"created","issue":{"url":"https://api.github.com/repos/javalite/activejdbc/issues/630","repository_url":"https://api.github.com/repos/javalite/activejdbc","labels_url":"https://api.github.com/repos/javalite/activejdbc/issues/630/labels{/name}","comments_url":"https://api.github.com/repos/javalite/activejdbc/issues/630/comments","events_url":"https://api.github.com/repos/javalite/activejdbc/issues/630/events","html_url":"https://github.com/javalite/activejdbc/issues/630","id":253096004,"number":630,"title":"Add @Column annotation support","user":{"login":"nadilsons","id":556458,"avatar_url":"https://avatars2.githubusercontent.com/u/556458?v=4","gravatar_id":"","url":"https://api.github.com/users/nadilsons","html_url":"https://github.com/nadilsons","followers_url":"https://api.github.com/users/nadilsons/followers","following_url":"https://api.github.com/users/nadilsons/following{/other_user}","gists_url":"https://api.github.com/users/nadilsons/gists{/gist_id}","starred_url":"https://api.github.com/users/nadilsons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nadilsons/subscriptions","organizations_url":"https://api.github.com/users/nadilsons/orgs","repos_url":"https://api.github.com/users/nadilsons/repos","events_url":"https://api.github.com/users/nadilsons/events{/privacy}","received_events_url":"https://api.github.com/users/nadilsons/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2017-08-26T14:17:49Z","updated_at":"2017-08-31T14:32:57Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nI would like to suggest add `@Column` to provide some way to make the code more DRY\r\nFor example, instead of implement in that way\r\n\r\n``` java\r\npublic class Person extends Model {\r\n   public void setName(String name) {\r\n      set(\"name\", name);\r\n   }\r\n\r\n   public String getName() {\r\n      return getString(\"name\");\r\n   }\r\n}\r\n\r\nPerson p = Person.findById(1);\r\nname = p.get(\"name\");\r\n// or\r\nname = p.getName();\r\n```\r\n\r\nWe could use the `@Column` annotation to help us to do something like that\r\n\r\n```java\r\npublic class Person extends Model {\r\n    // in this case we could use only @Column because the attribute and column name are the same values\r\n    @Column(\"name\")\r\n    private String name;\r\n}\r\n\r\nPerson p = Person.findById(1);\r\nname = p.name;\r\n\r\np.name = \"new value\";\r\np.save();\r\n```\r\n\r\nWhat do you think about it?"},"comment":{"url":"https://api.github.com/repos/javalite/activejdbc/issues/comments/326314300","html_url":"https://github.com/javalite/activejdbc/issues/630#issuecomment-326314300","issue_url":"https://api.github.com/repos/javalite/activejdbc/issues/630","id":326314300,"user":{"login":"mikeebert","id":1092727,"avatar_url":"https://avatars0.githubusercontent.com/u/1092727?v=4","gravatar_id":"","url":"https://api.github.com/users/mikeebert","html_url":"https://github.com/mikeebert","followers_url":"https://api.github.com/users/mikeebert/followers","following_url":"https://api.github.com/users/mikeebert/following{/other_user}","gists_url":"https://api.github.com/users/mikeebert/gists{/gist_id}","starred_url":"https://api.github.com/users/mikeebert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikeebert/subscriptions","organizations_url":"https://api.github.com/users/mikeebert/orgs","repos_url":"https://api.github.com/users/mikeebert/repos","events_url":"https://api.github.com/users/mikeebert/events{/privacy}","received_events_url":"https://api.github.com/users/mikeebert/received_events","type":"User","site_admin":false},"created_at":"2017-08-31T14:32:57Z","updated_at":"2017-08-31T14:32:57Z","author_association":"NONE","body":"@nadilsons & @ipolevoy - I could see the benefit to having the `@Column` notation, but I also don't see it being that much trouble to create the explicit getters and setters either. I find myself quite often needing to control the type of field coming in from a webapp or coming out of the database so I'd see myself more often than not just reverting to creating explicit getters & setters."}}
{"actor":{"display_login":"mikeebert"}}