greenrobot / greenDAO

greenDAO is a light & fast ORM solution for Android that maps objects to SQLite databases.
http://greenrobot.org/greendao/
12.63k stars 2.89k forks source link

I want to select one column How? #380

Closed TaherZak2 closed 8 years ago

greenrobot-team commented 8 years ago

greenDAO will always map all columns into your entity objects, as far as I know it is currently not possible to return only specific columns/properties.

You may want to fall back to a raw SQLite query then.

-ut

greenrobot-team commented 8 years ago

Whoops, not correct. You have to do an actual raw SQL query on the database yourself. The link I have given above only works with where statements. -ut

greenrobot commented 8 years ago

As a side note, greenDAO is pretty fast. So grabbing the entire entity just to get one property is fine most of cases.

greenrobot commented 8 years ago

Added an FAQ entry today for this; http://greenrobot.org/greendao/documentation/technical-faq/