Well, there's an initial bit of FQL work in the latest snapshots. Specifically, FqlOperations give you a method with this signature:
Code:
<T> List<T> query(String fql, FqlResultMapper<T> mapper);
Essentially, you pass in whatever FQL you want along with your implementation of the FqlResultMapper and it will return whatever type the result mapper returns. For example, here's some code from the FqlTemplateTest:
Code:
List<StatusObject> results = facebook.fqlOperations().query("SELECT uid, status_id, message, time, source FROM status WHERE uid=me()", new FqlResultMapper<StatusObject>() {
public StatusObject mapObject(FqlResult result) {
StatusObject status = new StatusObject();
status.uid = result.getInteger("uid");
status.statusId = result.getString("status_id");
status.statusIdLong = result.getLong("status_id");
status.message = result.getString("message");
status.time = result.getTime("time");
status.source = result.getLong("source");
return status;
}
});
It doesn't yet support multi-query (I envision that being a case where you send in a Map<String, String> of queries instead of a simple String), but single queries should work fine. AFAIK, I'm the only one who has tested this, so I welcome you to try it out and let me know what's missing or doesn't work (aside from multi-query, which I already know about).