* @param subscriptionContext
* @return true if this user is subscribed
*/
@SuppressWarnings("unchecked")
public boolean isSubscribed(Identity identity, SubscriptionContext subscriptionContext) {
DB db = DBFactory.getInstance();
String q = "select count(sub) from org.olat.notifications.SubscriberImpl sub inner join sub.publisher as pub "
+ " where sub.identity = :anIdentity and pub.resName = :resName and pub.resId = :resId"
+ " and pub.subidentifier = :subidentifier group by sub";
DBQuery query = db.createQuery(q);
query.setEntity("anIdentity", identity);
query.setString("resName", subscriptionContext.getResName());
query.setLong("resId", subscriptionContext.getResId().longValue());
query.setString("subidentifier", subscriptionContext.getSubidentifier());
List res = query.list();