public bool SupportsQueryLanguage(QueryLanguageType type) { if (type == QueryLanguageType.HQL) { return(true); } else { return(false); } }
public IList ExecuteQuery(QueryLanguageType type, string query, string[] paramNames, object[] paramValues) { if (type == QueryLanguageType.HQL) { IQuery q = session.CreateQuery(query); for (int i = 0; i < paramNames.Length; i++) { q.SetParameter(paramNames[i], paramValues[i]); } return(q.List()); } else { throw new InvalidOperationException("Query language not supported."); } }