A: 

For time being, I have replaced the Enums with simple integer constants. Reported this case as an issue in the google app engine : http://code.google.com/p/googleappengine/issues/detail?id=2927

Gopi
A: 

For a parameter other than a String or an int, I believe you need to use declareParameters instead. Try something like this:

Query q = pm.newQuery(com.xxx.yyy.User.class);
q.setFilter("role == p1");  //p1 is a variable place holder
q.declareParameters("Enum p1"); //here you define the data type for the variable, in this case an Enum
q.setRange(0, 50);
q.setOrdering("key desc");

AbstractQueryResult results = (AbstractQueryResult) pm.newQuery(q).execute(admin);

or if you want more gql like syntax -

Query query = pm.newQuery("SELECT FROM com.xxx.yyy.User WHERE role == p1 ORDER BY key desc RANGE 0,50");
query.declareParameters("Enum p1");
AbstractQueryResult results = (AbstractQueryResult) pm.newQuery(q).execute(admin);
dayal
Did you try this out before posting? I would not file a bug with google until I ran out of all possible ways.
Gopi