Jaguar-dart / jaguar_orm

Source-generated ORM with relations (one-to-one, one-to-many, many-to-many), preloading, cascading, polymorphic relations, etc
https://jaguar-dart.github.io
BSD 3-Clause "New" or "Revised" License
217 stars 52 forks source link

Find registers when value is null #109

Closed hjJunior closed 5 years ago

hjJunior commented 5 years ago

I'm using Jaguar ORM for Flutter, and I'm having issue to find a register where int field is null, is it supported?

Scenario

On my model I have externalId

  @Column(isNullable: true)
  int externalId;

And on the bean I created a method to get only where externalId doesn't have value

await findMany(finder.where(externalId.eq(null)));

But this return to me none registers, but I can see that exists registers with externalId null, to confirm it, I called to getAll() and printed

[Model {id: 1, externalId: 13 }, Model {id: 2, externalId: 14 }, Model {id: 3, externalId: null }]
tejainece commented 5 years ago

@hjJunior IS NULL operator is needed for this. It is being implemented here:

https://github.com/Jaguar-dart/jaguar_orm/pull/107

tejainece commented 5 years ago

Use jaguar_query 2.2.5. There is an iss operator.

tejainece commented 5 years ago

@hjJunior I think this is fixed. Please reopen the issue if you find issues.

hjJunior commented 5 years ago

thxs :)