Created
October 22, 2010 11:02
-
-
Save anonymous/640347 to your computer and use it in GitHub Desktop.
GenericReportDataRepository<T> (NHibernate stored procs)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using Castle.Facilities.NHibernateIntegration; | |
| using System.Collections; | |
| using NHibernate; | |
| using NHibernate.Transform; | |
| namespace Ideal.Reporting.Domain | |
| { | |
| public class GenericReportDataRepository<T> : Ideal.Web.ReportDataRepositoryBase<T> | |
| { | |
| public GenericReportDataRepository(ISessionManager sessionManager) | |
| : base(sessionManager) | |
| { | |
| } | |
| public IList<T> GetReportData<T>( Hashtable parameters, string spname, string appname) | |
| { | |
| string sql = string.Empty; | |
| ISQLQuery sessSql = null; | |
| sql = string.Format("@exec {0} ", spname); | |
| sessSql = base._sessionManager.OpenSession("rttm").CreateSQLQuery(sql); | |
| sessSql = AddScalarValues(sessSql, typeof(T)); | |
| return sessSql.SetResultTransformer(new AliasToBeanResultTransformer(typeof(T))).List<T>(); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment