As Simon said, you have to be explicit. However, the workaround is to use a bit of dynamic apex to get all the fields you need. You then pass those into a dynamic query. Here's a class you can get started with for getting all fields for an object:
public class DynamicApexFieldLister
{
public static Map<String, Schema.SObjectField> getFieldsForSObject(SObjectType s)
{
Map<String, Schema.SObjectField> fieldMap = s.getDescribe().fields.getMap();
return fieldMap;
}
public static Map<String, Schema.SObjectField> getFieldsForSObject(String s)
{
return getFieldsForSObject(Schema.getGlobalDescribe().get(s));
}
public static Map<String, Schema.SObjectField> getFieldsForSObject(SObject s)
{
return getFieldsForSObject(s.getSObjectType());
}
public static Map<String, Schema.SObjectField> getUpdateableFieldsForSObject(SObjectType s)
{
Map<String, Schema.SObjectField> objectFields = getFieldsForSObject(s);
Map<String, Schema.SObjectField> updateableFields = new Map<String, Schema.SObjectField>();
for (String fieldName : objectFields.keySet())
{
if (objectFields.get(fieldName).getDescribe().isUpdateable())
updateableFields.put(fieldName, objectFields.get(fieldName));
}
return updateableFields;
}
public static Map<String, Schema.SObjectField> getUpdateableFieldsForSObject(String s)
{
return getUpdateableFieldsForSObject(Schema.getGlobalDescribe().get(s));
}
public static Map<String, Schema.SObjectField> getUpdateableFieldsForSObject(SObject s)
{
return getUpdateableFieldsForSObject(s.getSObjectType());
}
}
Forgot to mention, be cautious when using the describes as there are limits around the number of describes you can make as well as the size of your query.
No, you have to be explicit.
As Simon said, you have to be explicit. However, the workaround is to use a bit of dynamic apex to get all the fields you need. You then pass those into a dynamic query. Here's a class you can get started with for getting all fields for an object:
Forgot to mention, be cautious when using the describes as there are limits around the number of describes you can make as well as the size of your query.