Пример #1
0
        public override SqlString Render(System.Collections.IList args, NHibernate.Engine.ISessionFactoryImplementor factory)
        {
            if (args.Count != allowedArgsCount)
            {
                throw new QueryException(string.Format("function '{0}' takes {1} arguments.", name, allowedArgsCount));
            }

            return(base.Render(args, factory));
        }
Пример #2
0
        /// <summary>
        /// Creates new criteria object and applies the transaction timeout
        /// configured as part of the transaction attributes
        /// example: <tx:method name="Get*" read-only="true" timeout="900"/>
        /// </summary>
        /// <typeparam name="T">Type requesting the criteria</typeparam>
        /// <param name="session">NHibernate session</param>
        /// <returns></returns>
        private ICriteria GetCriteria <T>(ISession session)
        {
            ICriteria Criteria = session.CreateCriteria(typeof(T));

            SessionFactoryUtils.ApplyTransactionTimeout(Criteria, sessionFactory);

            NHibernate.Engine.ISessionFactoryImplementor sessionFactoryImpl = sessionFactory as NHibernate.Engine.ISessionFactoryImplementor;
            if (sessionFactoryImpl != null && sessionFactoryImpl.Settings.IsQueryCacheEnabled)
            {
                Criteria.SetCacheable(true);
            }
            return(Criteria);
        }
Пример #3
0
 public override SqlString Render(IList args, NHibernate.Engine.ISessionFactoryImplementor factory)
 {
     var result = base.Render(args, factory);
     return result.Replace("round_to_integer(", "cast(round(").Append(" as integer)");
 }
Пример #4
0
 public override SqlString Render(IList args, NHibernate.Engine.ISessionFactoryImplementor factory)
 {
     var result = base.Render(args, factory);
     return result.Replace("parens(", "(");
 }
Пример #5
0
 public override SqlString Render (IList args, NHibernate.Engine.ISessionFactoryImplementor factory)
 {
     var result = base.Render(args, factory);
     return result.Replace("group_concat(", "group_concat(distinct ");
 }
Пример #6
0
 protected override bool AppliesTo(NHibernate.Engine.ISessionFactoryImplementor factory)
 {
     return(factory.ConnectionProvider.Driver is Driver.OracleDataClientDriver);
 }