예제 #1
0
 public bool SupportsQueryLanguage(QueryLanguageType type)
 {
     if (type == QueryLanguageType.HQL)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
예제 #2
0
 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.");
     }
 }