{"action":"created","issue":{"url":"https://api.github.com/repos/pardom/ActiveAndroid/issues/135","labels_url":"https://api.github.com/repos/pardom/ActiveAndroid/issues/135/labels{/name}","comments_url":"https://api.github.com/repos/pardom/ActiveAndroid/issues/135/comments","events_url":"https://api.github.com/repos/pardom/ActiveAndroid/issues/135/events","html_url":"https://github.com/pardom/ActiveAndroid/issues/135","id":21971872,"number":135,"title":"Database Creation Fails for Single Class","user":{"login":"tristanoneil","id":316507,"avatar_url":"https://avatars.githubusercontent.com/u/316507?v=3","gravatar_id":"","url":"https://api.github.com/users/tristanoneil","html_url":"https://github.com/tristanoneil","followers_url":"https://api.github.com/users/tristanoneil/followers","following_url":"https://api.github.com/users/tristanoneil/following{/other_user}","gists_url":"https://api.github.com/users/tristanoneil/gists{/gist_id}","starred_url":"https://api.github.com/users/tristanoneil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tristanoneil/subscriptions","organizations_url":"https://api.github.com/users/tristanoneil/orgs","repos_url":"https://api.github.com/users/tristanoneil/repos","events_url":"https://api.github.com/users/tristanoneil/events{/privacy}","received_events_url":"https://api.github.com/users/tristanoneil/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2013-11-01T17:49:01Z","updated_at":"2015-12-03T03:38:25Z","closed_at":null,"body":"I've been able to get ActiveAndroid working with other classes in my app but one particular class causes the following stack trace.\r\n\r\n```\r\nCaused by: android.database.sqlite.SQLiteException: near \"(\": syntax error (code 1): , while compiling: CREATE TABLE IF NOT EXISTS  (Id INTEGER PRIMARY KEY AUTOINCREMENT);\r\n            at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)\r\n            at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:889)\r\n            at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:500)\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.SQLiteStatement.<init>(SQLiteStatement.java:31)\r\n            at android.database.sqlite.SQLiteDatabase.executeSql(SQLiteDatabase.java:1672)\r\n            at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1603)\r\n            at com.activeandroid.DatabaseHelper.executeCreate(Unknown Source)\r\n            at com.activeandroid.DatabaseHelper.onCreate(Unknown Source)\r\n            at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:252)\r\n            at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:164)\r\n            at com.activeandroid.Cache.openDatabase(Unknown Source)\r\n            at com.activeandroid.Cache.initialize(Unknown Source)\r\n            at com.activeandroid.ActiveAndroid.initialize(Unknown Source)\r\n            at com.activeandroid.ActiveAndroid.initialize(Unknown Source)\r\n            at com.activeandroid.ActiveAndroid.initialize(Unknown Source)\r\n            at com.activeandroid.app.Application.onCreate(Unknown Source)\r\n            at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)\r\n            at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4444)\r\n            at android.app.ActivityThread.access$1300(ActivityThread.java:141)\r\n            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)\r\n            at android.os.Handler.dispatchMessage(Handler.java:99)\r\n            at android.os.Looper.loop(Looper.java:137)\r\n            at android.app.ActivityThread.main(ActivityThread.java:5103)\r\n            at java.lang.reflect.Method.invokeNative(Native Method)\r\n            at java.lang.reflect.Method.invoke(Method.java:525)\r\n            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)\r\n            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)\r\n            at dalvik.system.NativeStart.main(Native Method)\r\n```\r\n\r\nThe class definition looks like.\r\n\r\n```java\r\npackage com.tristanoneil.flashcards;\r\n\r\nimport com.activeandroid.Model;\r\nimport com.activeandroid.annotation.Column;\r\nimport com.activeandroid.annotation.Table;\r\n\r\n@Table(name = \"category\")\r\npublic class Category extends Model {\r\n    @Column(name = \"name\")\r\n    public String name;\r\n}\r\n```\r\n\r\nIt seems to me that it's not getting the table name for some reason. Any insight?"},"comment":{"url":"https://api.github.com/repos/pardom/ActiveAndroid/issues/comments/161506349","html_url":"https://github.com/pardom/ActiveAndroid/issues/135#issuecomment-161506349","issue_url":"https://api.github.com/repos/pardom/ActiveAndroid/issues/135","id":161506349,"user":{"login":"jlhonora","id":1577721,"avatar_url":"https://avatars.githubusercontent.com/u/1577721?v=3","gravatar_id":"","url":"https://api.github.com/users/jlhonora","html_url":"https://github.com/jlhonora","followers_url":"https://api.github.com/users/jlhonora/followers","following_url":"https://api.github.com/users/jlhonora/following{/other_user}","gists_url":"https://api.github.com/users/jlhonora/gists{/gist_id}","starred_url":"https://api.github.com/users/jlhonora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlhonora/subscriptions","organizations_url":"https://api.github.com/users/jlhonora/orgs","repos_url":"https://api.github.com/users/jlhonora/repos","events_url":"https://api.github.com/users/jlhonora/events{/privacy}","received_events_url":"https://api.github.com/users/jlhonora/received_events","type":"User","site_admin":false},"created_at":"2015-12-03T03:38:25Z","updated_at":"2015-12-03T03:38:25Z","body":"Did you declare an empty constructor for your class? From the [wiki](https://github.com/pardom/ActiveAndroid/wiki/Creating-your-database-model):\r\n\r\n> ActiveAndroid uses the standard-constructor of your class to instantiate objects. If you define your own constructors you have to define a parameterless constructor as well."}}