code: protected T getSingleResult(Query q) {
  		try {
  			@SuppressWarnings("unchecked")
  			T retVal = (T) q.getSingleResult();
  			return retVal;
  		} catch (NoResultException e) {
  			return null;
  		}
  	}
docs: Executes a query that returns a single record. In the case of no result, rather than throwing
  an exception, null is returned.
  @param q Query to Execute
  @return T The instance to return, or null if no result.