{"action":"created","issue":{"url":"https://api.github.com/repos/Raizlabs/DBFlow/issues/815","repository_url":"https://api.github.com/repos/Raizlabs/DBFlow","labels_url":"https://api.github.com/repos/Raizlabs/DBFlow/issues/815/labels{/name}","comments_url":"https://api.github.com/repos/Raizlabs/DBFlow/issues/815/comments","events_url":"https://api.github.com/repos/Raizlabs/DBFlow/issues/815/events","html_url":"https://github.com/Raizlabs/DBFlow/issues/815","id":154766971,"number":815,"title":"Problem insert list of object in Sqlite database","user":{"login":"pascalito007","id":4120406,"avatar_url":"https://avatars.githubusercontent.com/u/4120406?v=3","gravatar_id":"","url":"https://api.github.com/users/pascalito007","html_url":"https://github.com/pascalito007","followers_url":"https://api.github.com/users/pascalito007/followers","following_url":"https://api.github.com/users/pascalito007/following{/other_user}","gists_url":"https://api.github.com/users/pascalito007/gists{/gist_id}","starred_url":"https://api.github.com/users/pascalito007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pascalito007/subscriptions","organizations_url":"https://api.github.com/users/pascalito007/orgs","repos_url":"https://api.github.com/users/pascalito007/repos","events_url":"https://api.github.com/users/pascalito007/events{/privacy}","received_events_url":"https://api.github.com/users/pascalito007/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-05-13T17:53:36Z","updated_at":"2016-05-25T00:03:53Z","closed_at":"2016-05-25T00:03:53Z","body":"DBFlow Version:3.0.0-beta6\r\nIssue Kind (Bug, Question, Feature):Bug\r\n\r\nDescription: \r\nI have a List of country (countryList). when insert this list in database, data are not insert in database.\r\n```java\r\nList<Country> countryList=new ArrayList();\r\ncountryList.add(new Country(\"country1\"));\r\ncountryList.add(new Country(\"country2\"));\r\n```\r\n\r\n```java\r\nProcessModelTransaction<Country> processModelTransaction =\r\n                new ProcessModelTransaction.Builder<>(new ProcessModelTransaction.ProcessModel<Country>() {\r\n                    @Override\r\n                    public void processModel(Country model) {\r\n                        //processCalled.set(true);\r\n                    }\r\n                }).addAll(countryList).build();\r\n        DatabaseDefinition database = FlowManager.getDatabase(AppDataBase.class);\r\n        Transaction transaction = database.beginTransactionAsync(processModelTransaction).build();\r\n        transaction.execute();\r\n ```\r\nAlso I would like to know the meaning of\r\n```java \r\nnew ProcessModelTransaction.ProcessModel<Country>() {\r\n                    @Override\r\n                    public void processModel(Country model) {\r\n                        //processCalled.set(true);\r\n                    }\r\n```\r\n instruction and the meaning of \r\n```java\r\nDatabaseDefinition database = FlowManager.getDatabase(AppDataBase.class);\r\n        Transaction transaction = database.beginTransactionAsync(processModelTransaction).build();\r\n```\r\n and when can I use this or not.\r\nThanks"},"comment":{"url":"https://api.github.com/repos/Raizlabs/DBFlow/issues/comments/221437736","html_url":"https://github.com/Raizlabs/DBFlow/issues/815#issuecomment-221437736","issue_url":"https://api.github.com/repos/Raizlabs/DBFlow/issues/815","id":221437736,"user":{"login":"agrosner","id":2117859,"avatar_url":"https://avatars.githubusercontent.com/u/2117859?v=3","gravatar_id":"","url":"https://api.github.com/users/agrosner","html_url":"https://github.com/agrosner","followers_url":"https://api.github.com/users/agrosner/followers","following_url":"https://api.github.com/users/agrosner/following{/other_user}","gists_url":"https://api.github.com/users/agrosner/gists{/gist_id}","starred_url":"https://api.github.com/users/agrosner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agrosner/subscriptions","organizations_url":"https://api.github.com/users/agrosner/orgs","repos_url":"https://api.github.com/users/agrosner/repos","events_url":"https://api.github.com/users/agrosner/events{/privacy}","received_events_url":"https://api.github.com/users/agrosner/received_events","type":"User","site_admin":false},"created_at":"2016-05-25T00:03:53Z","updated_at":"2016-05-25T00:03:53Z","body":"yeah I was going to say you're not actually doing anything in the transaction.\r\n\r\n```java\r\nnew ProcessModelTransaction.ProcessModel<Country>() {\r\n                    @Override\r\n                    public void processModel(Country model) {\r\n                        //processCalled.set(true);\r\n                    }\r\n```\r\nwas just an example. The interface simply provides a method to process a Model on. If it was in Kotlin, that would simply be a lambda, but java is not so nice.\r\n\r\n```java\r\nDatabaseDefinition database = FlowManager.getDatabase(AppDataBase.class);\r\n        Transaction transaction = database.beginTransactionAsync(processModelTransaction).build();\r\n```\r\n\r\nConstructs a transaction by which you can use to operate in the background on the Database access thread. "}}
{"actor":{"display_login":"agrosner"}}