I have two entities: EntityA and EntityB. EntityB has a foreign field of EntityA:
@DatabaseField(foreign=true, columnName=ENT_A_NAME)
private EntityA entityA;
Now I want to query all entries of EntityB where EntityA is null. So I’ve made the following query:
bDao.queryBuilder().where().isNull(EntityB.Ent_A_NAME).prepare();
If I execute the query I get an empty result set back.
If I execute queryAll() I see that the entries of EntityB have always an associated Order-Object with all values set to null/0.
How can I execute my query?
I’m not sure @Toni4780. The following test case works for me. I don’t see anything that you are doing wrong.
In the table for
EntityB, ORMLite actually stores the id of theEntityAso I am wondering if it is null or 0. Have you tried the following?or both:
Here’s my unit test code that works: