public void NullSafeSet(System.Data.IDbCommand cmd, object value, int index, NHibernate.Engine.ISessionImplementor session)
        {
            DateTimeRange dtr = (DateTimeRange)value;

            NHibernateUtil.DateTime.NullSafeSet(cmd, dtr == null ? null : dtr.From, index, session);
            NHibernateUtil.DateTime.NullSafeSet(cmd, dtr == null ? null : dtr.Until, index + 1, session);
        }
        public object NullSafeGet(System.Data.IDataReader dr, string[] names, NHibernate.Engine.ISessionImplementor session, object owner)
        {
            DateTime?from  = (DateTime?)NHibernateUtil.DateTime.NullSafeGet(dr, names[0], session, owner);
            DateTime?until = (DateTime?)NHibernateUtil.DateTime.NullSafeGet(dr, names[1], session, owner);

            //return (from == null && until == null) ? null : new DateTimeRange(from, until);
            return(new DateTimeRange(from, until));
        }
Esempio n. 3
0
        public void NullSafeSet(System.Data.IDbCommand st, Object value, int index, NHibernate.Engine.ISessionImplementor session)
        {
            string str = null;

            if (value != null)
            {
                str = value.ToString().Trim();
            }
            if (str == String.Empty)
            {
                str = null;
                NHibernateUtil.String.NullSafeSet(st, str, index, session);
            }
            else
            {
                NHibernateUtil.String.NullSafeSet(st, value, index, session);
            }
        }
 public object Disassemble(object value, NHibernate.Engine.ISessionImplementor session)
 {
     return(DeepCopy(value));
 }
 public object Assemble(object cached, NHibernate.Engine.ISessionImplementor session, object owner)
 {
     return(DeepCopy(cached));
 }
Esempio n. 6
0
 public object NullSafeGet(System.Data.IDataReader rs, String[] names, NHibernate.Engine.ISessionImplementor session, Object owner)
 {
     return(NHibernateUtil.String.NullSafeGet(rs, names[0], session, owner));
 }
 public void NullSafeSet(DbCommand st, Object value, int index,
                         bool[] settable, NHibernate.Engine.ISessionImplementor session)
 {
     throw new NotImplementedException();
 }
 object ILazyInitializer.GetImplementation(NHibernate.Engine.ISessionImplementor s)
 {
     return(wrapped);
 }