{"action":"closed","issue":{"url":"https://api.github.com/repos/Raizlabs/DBFlow/issues/198","labels_url":"https://api.github.com/repos/Raizlabs/DBFlow/issues/198/labels{/name}","comments_url":"https://api.github.com/repos/Raizlabs/DBFlow/issues/198/comments","events_url":"https://api.github.com/repos/Raizlabs/DBFlow/issues/198/events","html_url":"https://github.com/Raizlabs/DBFlow/issues/198","id":68527306,"number":198,"title":"save() can insert two objects","user":{"login":"FredJul","id":3428124,"avatar_url":"https://avatars.githubusercontent.com/u/3428124?v=3","gravatar_id":"","url":"https://api.github.com/users/FredJul","html_url":"https://github.com/FredJul","followers_url":"https://api.github.com/users/FredJul/followers","following_url":"https://api.github.com/users/FredJul/following{/other_user}","gists_url":"https://api.github.com/users/FredJul/gists{/gist_id}","starred_url":"https://api.github.com/users/FredJul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FredJul/subscriptions","organizations_url":"https://api.github.com/users/FredJul/orgs","repos_url":"https://api.github.com/users/FredJul/repos","events_url":"https://api.github.com/users/FredJul/events{/privacy}","received_events_url":"https://api.github.com/users/FredJul/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-14T23:35:57Z","updated_at":"2015-04-21T14:28:53Z","closed_at":"2015-04-21T14:28:53Z","body":"First of all, thank you for this awesome lib!\r\n\r\nUnfortunately, I've encountered an issue. Let's say you have a class defined like this:\r\n\r\n      public class Task extends BaseModel implements Parcelable {\r\n          @Column(columnType = Column.PRIMARY_KEY_AUTO_INCREMENT)\r\n          public int id;\r\n     }\r\n\r\nIf you create yourself an object with an specific id, it is inserted twice:\r\n\r\n      Log.e(\"Test\", \"first count=\" + new Select().from(Task.class).queryList().size()); // display 0\r\n      Task test = new Task();\r\n      test.id=23;\r\n      test.save(false);\r\n      Log.e(\"Test\", \"second count=\" + new Select().from(Task.class).queryList().size()); // display 2 !!\r\n\r\nIn my project, I need to specify the id to restore the data from the server and keep the relations between this object and the others."}}