1

How to make a simple sql where in another field that is not the primary key, it uses the method where the class manager? does anyone know?

Not found in the documentation (http://droidparts.org) official as still under construction!

Thanks all!

yanchenko
  • 56,576
  • 33
  • 147
  • 165
claudsan
  • 195
  • 1
  • 2
  • 8
  • Could you please explain a bit more what you want to do? – yanchenko Apr 27 '13 at 20:24
  • example table products(_id,name,external_id), where find by external_id or select like name. Not found in the documentation example only read by the method which seeks the primary key – claudsan Apr 27 '13 at 20:26

1 Answers1

1

In an EntityManager subclass:

// Select is used to provide data to EntityCursorAdapter
Select<EntityType> select = select().columns("_id", "name").where("external_id",
        Is.EQUAL, 10);
// alternatively, call execute() to get the underlying Cursor
Cursor cursor = select().where("name", Is.LIKE, "%%alex%%").execute();
yanchenko
  • 56,576
  • 33
  • 147
  • 165