Table declaration
@DatabaseTable(tableName = "alarmes")
public class ListenerAlarme {
@DatabaseField(generatedId = true)
public long id;
@DatabaseField(canBeNull = true)
public Date dataAlarme;
@DatabaseField(canBeNull = true)
public boolean notificado;
@DatabaseField(foreign = true, canBeNull = false, columnName = "id_item")
public ListenerItem item;
public ListenerAlarme(){
}
}
Inquiry
List<ListenerAlarme> alarmeList = mAlarmeDao.queryBuilder().where().eq("id_item", mItem).query();
Error
07-27 16:06:12.304 14544-14544/makerapp.android.minhastarefas E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{makerapp.android.minhastarefas/makerapp.android.minhastarefas.ItemActivity}: java.lang.RuntimeException: java.sql.SQLException: Problems executing Android query: SELECT * FROM 'alarmes' WHERE 'id_item' = 1
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2121)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2146)
at android.app.ActivityThread.access$700(ActivityThread.java:140)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1238)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:177)
at android.app.ActivityThread.main(ActivityThread.java:4947)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
at dalvik.system.NativeStart.main(Native Method)
I am trying to query if there is an item with the id
that I have saved in the alarmes
table and generates this error.