ModelRefAttributeMeta<ActivityModel, ModelRef<UserModel>, UserModel> refMeta = meta.userModelRef;
CoreAttributeMeta<ActivityModel,Category> categoryMeta = meta.attachmentsType;
S3QueryResultList<ActivityModel> list = Datastore.query(meta)
.filter(refMeta.equal(userModel.getKey()), categoryMeta.equal(category))
.sort(new Sort(ActivityModelMeta.get().published, SortDirection.DESCENDING))
.limit(num)
.asQueryResultList();
return list;
}