Hi,
I have a rather large class stored in the datastore, for example a User class with lots of fields (I'm using java, omitting all decorations below example for clarity):
@PersistenceCapable
class User {
private String username;
private String city;
private String state;
private String country;
private String favColor;
}
For some user queries, I only need the favColor property, but right now I'm doing this:
SELECT FROM " + User.class.getName() + " WHERE username == 'bob'
which should deserialize all of the entity properties. Is it possible to do something instead like:
SELECT username, favColor FROM " + User.class.getName() + " WHERE username == 'bob'
and then in this case, all of the returned User instances will only spend time deserializing the username and favColor properties, and not the city/state/country properties? If so, then I suppose all the other properties will be null (in the case of objects) or 0 for int/long/float?
Thank you