Let's say I have an ObjectBox entity like so:
@Entity
public class CountryEntity {
@Id
private long entityId;
private String name;
private float area;
private int population;
private String subRegion;
private String region;
private String code3;
private String capitalCity;
setters, getters }
and a query :
public ObjectBoxLiveData<CountryEntity> getAllCountries(){
Box<CountryEntity> countryBox = boxStore.boxFor(CountryEntity.class);
return new ObjectBoxLiveData<CountryEntity>(
countryBox.query().order(CountryEntity_.name).build());
}
This selects all countries. Is there a way to select only some "columns" eg. name and area for example and not the others?
Oftentimes I don't really need all columns but rather a subset and I feel pretty guilty about querying all that data unnecessarily.
Thank you!