Search code examples
androidandroid-frameworkdroidparts

Simple where in Droidparts?


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!


Solution

  • 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();