{"action":"created","issue":{"url":"https://api.github.com/repos/satyan/sugar/issues/673","repository_url":"https://api.github.com/repos/satyan/sugar","labels_url":"https://api.github.com/repos/satyan/sugar/issues/673/labels{/name}","comments_url":"https://api.github.com/repos/satyan/sugar/issues/673/comments","events_url":"https://api.github.com/repos/satyan/sugar/issues/673/events","html_url":"https://github.com/satyan/sugar/issues/673","id":177229655,"number":673,"title":"SQLiteException: no such table:","user":{"login":"dacsi","id":1886630,"avatar_url":"https://avatars.githubusercontent.com/u/1886630?v=3","gravatar_id":"","url":"https://api.github.com/users/dacsi","html_url":"https://github.com/dacsi","followers_url":"https://api.github.com/users/dacsi/followers","following_url":"https://api.github.com/users/dacsi/following{/other_user}","gists_url":"https://api.github.com/users/dacsi/gists{/gist_id}","starred_url":"https://api.github.com/users/dacsi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dacsi/subscriptions","organizations_url":"https://api.github.com/users/dacsi/orgs","repos_url":"https://api.github.com/users/dacsi/repos","events_url":"https://api.github.com/users/dacsi/events{/privacy}","received_events_url":"https://api.github.com/users/dacsi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-09-15T16:53:13Z","updated_at":"2016-09-18T07:36:05Z","closed_at":null,"body":"\r\n\r\n\r\nHello I have been encountering this issue both on the emulator and on my physical Nexus 5. My code works as follow:\r\n1) the fragment calls this line in onCreateView `if(FavoriteUtils.checkIfThisIsFavorite(mShow))`\r\n\r\n2) then this method gets executed \r\n```\r\npublic static boolean checkIfThisIsFavorite(Show s){\r\n        List<Show> results = getListFromDb(s, WHERE_CLAUSE_ID);\r\n        if(results.size() > 0){\r\n            //found match\r\n            return true;\r\n        }else {\r\n            //no match\r\n            return false;\r\n        }\r\n    }\r\n```\r\n\r\n3) Then finally this\r\n\r\n```\r\n    private static List<Show> getListFromDb(Show s, String whereClause){\r\n        int showId = s.getShowId();\r\n         return Select.from(Show.class)\r\n                .where(Condition.prop(whereClause)\r\n                        .eq(Integer.valueOf(showId)\r\n                                .toString()))\r\n                .list(); // Line of crash \r\n    }\r\n```\r\n\r\nThis is the version of sugar ORM I'm using `compile 'com.github.satyan:sugar:1.4'`.\r\n\r\nThis is my manifest's application tag.\r\n```\r\n<application\r\n        android:name=\"com.orm.SugarApp\"\r\n        android:allowBackup=\"true\"\r\n        android:icon=\"@mipmap/ic_launcher\"\r\n        android:label=\"@string/app_name\"\r\n        android:supportsRtl=\"true\"\r\n        android:theme=\"@style/AppTheme\">\r\n\r\n        <meta-data android:name=\"DATABASE\" android:value=\"fav.db\" />\r\n        <meta-data android:name=\"VERSION\" android:value=\"2\" />\r\n         //I manually removed the other two tags just to be sure, no difference\r\n...\r\n</application>\r\n```\r\n\r\nAnd this is my model class:\r\n```\r\npublic class Show extends SugarRecord {\r\n    int showId;\r\n    String title; // original_title\r\n    String image; // poster_path\r\n    String image2; // backdrop_path used in DetailActivity\r\n    String overview;\r\n    int rating; // vote_average\r\n    String date; // release_date\r\n\r\n    public Show() {\r\n\r\n    }\r\n\r\n    public Show(JSONObject movie) throws JSONException {\r\n        this.showId = movie.getInt(\"id\");\r\n        this.title = movie.getString(\"original_title\");\r\n        this.image = movie.getString(\"poster_path\");\r\n        this.image2 = movie.getString(\"backdrop_path\");\r\n        this.overview = movie.getString(\"overview\");\r\n        this.rating = movie.getInt(\"vote_average\");\r\n        this.date = movie.getString(\"release_date\");\r\n    }\r\n\r\n    public Show(JSONObject movie, int notNeeded) throws JSONException {\r\n        this.showId = movie.getInt(\"id\");\r\n        this.title = movie.getString(\"original_name\");\r\n        this.image = movie.getString(\"poster_path\");\r\n        this.image2 = movie.getString(\"backdrop_path\");\r\n        this.overview = movie.getString(\"overview\");\r\n        this.rating = movie.getInt(\"vote_average\");\r\n        this.date = movie.getString(\"first_air_date\");\r\n    }\r\n\r\n    public int getShowId() {\r\n        return showId;\r\n    }\r\n\r\n    public String getTitle() {\r\n        return title;\r\n    }\r\n\r\n    public String getImage() {\r\n        return \"http://image.tmdb.org/t/p/w185\" + image;\r\n    }\r\n\r\n    public String getImage2() {\r\n        return \"http://image.tmdb.org/t/p/w300\" + image2;\r\n    }\r\n\r\n    public String getOverview() {\r\n        return overview;\r\n    }\r\n\r\n    public int getRating() {\r\n        return rating;\r\n    }\r\n\r\n    public String getDate() {\r\n        return date;\r\n    }\r\n\r\n}\r\n\r\n```\r\n\r\n\r\n\r\nStacktrace:\r\n```\r\n 9-15 18:41:59.507 6307-6307/com.dcs.shows E/AndroidRuntime: FATAL EXCEPTION: main\r\n                                                             Process: com.dcs.shows, PID: 6307\r\n                                                             android.database.sqlite.SQLiteException: no such table: SHOW (code 1): , while compiling: SELECT * FROM SHOW WHERE (SHOW_ID = ? )\r\n                                                                 at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)\r\n                                                                 at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:887)\r\n                                                                 at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:498)\r\n                                                                 at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)\r\n                                                                 at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:58)\r\n                                                                 at android.database.sqlite.SQLiteQuery.<init>(SQLiteQuery.java:37)\r\n                                                                 at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:44)\r\n                                                                 at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1316)\r\n                                                                 at android.database.sqlite.SQLiteDatabase.queryWithFactory(SQLiteDatabase.java:1163)\r\n                                                                 at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1034)\r\n                                                                 at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1240)\r\n                                                                 at com.orm.SugarRecord.find(SugarRecord.java:192)\r\n                                                                 at com.orm.query.Select.list(Select.java:118)\r\n                                                                 at com.dcs.shows.utils.FavoriteUtils.getListFromDb(FavoriteUtils.java:38)\r\n                                                                 at com.dcs.shows.utils.FavoriteUtils.checkIfThisIsFavorite(FavoriteUtils.java:23)\r\n                                                                 at com.dcs.shows.DetailFragment.onCreateView(DetailFragment.java:83)\r\n                                                                 at android.support.v4.app.Fragment.performCreateView(Fragment.java:2074)\r\n                                                                 at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)\r\n                                                                 at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1286)\r\n                                                                 at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:758)\r\n                                                                 at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1671)\r\n                                                                 at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:532)\r\n                                                                 at android.os.Handler.handleCallback(Handler.java:739)\r\n                                                                 at android.os.Handler.dispatchMessage(Handler.java:95)\r\n                                                                 at android.os.Looper.loop(Looper.java:148)\r\n                                                                 at android.app.ActivityThread.main(ActivityThread.java:5417)\r\n                                                                 at java.lang.reflect.Method.invoke(Native Method)\r\n                                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)\r\n                                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)\r\n```"},"comment":{"url":"https://api.github.com/repos/satyan/sugar/issues/comments/247831806","html_url":"https://github.com/satyan/sugar/issues/673#issuecomment-247831806","issue_url":"https://api.github.com/repos/satyan/sugar/issues/673","id":247831806,"user":{"login":"sagaratalatti","id":13254211,"avatar_url":"https://avatars.githubusercontent.com/u/13254211?v=3","gravatar_id":"","url":"https://api.github.com/users/sagaratalatti","html_url":"https://github.com/sagaratalatti","followers_url":"https://api.github.com/users/sagaratalatti/followers","following_url":"https://api.github.com/users/sagaratalatti/following{/other_user}","gists_url":"https://api.github.com/users/sagaratalatti/gists{/gist_id}","starred_url":"https://api.github.com/users/sagaratalatti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sagaratalatti/subscriptions","organizations_url":"https://api.github.com/users/sagaratalatti/orgs","repos_url":"https://api.github.com/users/sagaratalatti/repos","events_url":"https://api.github.com/users/sagaratalatti/events{/privacy}","received_events_url":"https://api.github.com/users/sagaratalatti/received_events","type":"User","site_admin":false},"created_at":"2016-09-18T07:36:05Z","updated_at":"2016-09-18T07:36:05Z","body":"I tried your method to check if the movie has been favored but in the log I get \r\n\r\n`D/SQL Log: SQLiteQuery: SELECT * FROM FAVORITE_MOVIE WHERE (MOVIE_ID = ? )`"}}
{"actor":{"display_login":"sagaratalatti"}}