{"action":"created","issue":{"url":"https://api.github.com/repos/gfx/Android-Orma/issues/216","repository_url":"https://api.github.com/repos/gfx/Android-Orma","labels_url":"https://api.github.com/repos/gfx/Android-Orma/issues/216/labels{/name}","comments_url":"https://api.github.com/repos/gfx/Android-Orma/issues/216/comments","events_url":"https://api.github.com/repos/gfx/Android-Orma/issues/216/events","html_url":"https://github.com/gfx/Android-Orma/issues/216","id":139300588,"number":216,"title":"Can we use the same column name in associated tables?","user":{"login":"jmatsu","id":4340693,"avatar_url":"https://avatars.githubusercontent.com/u/4340693?v=3","gravatar_id":"","url":"https://api.github.com/users/jmatsu","html_url":"https://github.com/jmatsu","followers_url":"https://api.github.com/users/jmatsu/followers","following_url":"https://api.github.com/users/jmatsu/following{/other_user}","gists_url":"https://api.github.com/users/jmatsu/gists{/gist_id}","starred_url":"https://api.github.com/users/jmatsu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmatsu/subscriptions","organizations_url":"https://api.github.com/users/jmatsu/orgs","repos_url":"https://api.github.com/users/jmatsu/repos","events_url":"https://api.github.com/users/jmatsu/events{/privacy}","received_events_url":"https://api.github.com/users/jmatsu/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/gfx/Android-Orma/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-03-08T15:07:14Z","updated_at":"2016-03-09T04:35:27Z","closed_at":null,"body":"When a table has a relation to another table, is there any way to handle the same column name in them?\r\n\r\nBelow example gives us an error which says `ambiguous column name: name`.\r\n\r\n```\r\n@Table\r\nclass ModelA {\r\n  @Column\r\n  public ModelB b;\r\n\r\n  @Column\r\n  public String name;\r\n\r\n  @PrimaryKey(auto = false)\r\n  public long a_id = 0L\r\n}\r\n\r\n@Table\r\nclass ModelB {\r\n  @Column\r\n  public String name;\r\n\r\n  @PrimaryKey(auto = false)\r\n  public long b_id = 0L\r\n}\r\n```\r\n\r\nBuilt select query (by `OrmaDatabase.builder(this).build().selectFromModelA().toList()` ) is\r\n\r\n```sql\r\nSELECT `a_id, `name`, `name`, `b_id` FROM `ModelA` JOIN `ModelB` ON `ModelA`.`b` = `ModelB`.`b_id` LIMIT 0,2000\r\n```"},"comment":{"url":"https://api.github.com/repos/gfx/Android-Orma/issues/comments/194110392","html_url":"https://github.com/gfx/Android-Orma/issues/216#issuecomment-194110392","issue_url":"https://api.github.com/repos/gfx/Android-Orma/issues/216","id":194110392,"user":{"login":"gfx","id":101800,"avatar_url":"https://avatars.githubusercontent.com/u/101800?v=3","gravatar_id":"","url":"https://api.github.com/users/gfx","html_url":"https://github.com/gfx","followers_url":"https://api.github.com/users/gfx/followers","following_url":"https://api.github.com/users/gfx/following{/other_user}","gists_url":"https://api.github.com/users/gfx/gists{/gist_id}","starred_url":"https://api.github.com/users/gfx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gfx/subscriptions","organizations_url":"https://api.github.com/users/gfx/orgs","repos_url":"https://api.github.com/users/gfx/repos","events_url":"https://api.github.com/users/gfx/events{/privacy}","received_events_url":"https://api.github.com/users/gfx/received_events","type":"User","site_admin":false},"created_at":"2016-03-09T04:35:26Z","updated_at":"2016-03-09T04:35:26Z","body":"Looks good. Will look into it."}}