예제 #1
0
        internal ObjectReader(Internals.Context context, ObjectQuery objectQuery, bool firstLevel)
        {
            this.context    = context;
            this.firstLevel = firstLevel;
            this.objectType = objectQuery.ObjectType;
            this.pageIndex  = objectQuery.PageIndex;
            this.hasEvents  = context.Mappings[this.objectType.ToString()].HasEvents;

            Internals.Commands commands = context.Mappings.Commands(this.objectType.ToString());
            if (objectQuery.PageSize > 0 && !objectQuery.SkipCounts)
            {
                string selectCount = commands.RecordCount(objectQuery.WhereClause);
                this.totalCount = int.Parse(context.Connection.GetScalarValue(this.objectType, CommandInfo.GetCount, selectCount).ToString());
                double pages = (double)(1 + (this.totalCount - 1) / objectQuery.PageSize);
                this.pageCount = int.Parse(Math.Floor(pages).ToString());
            }
            this.data      = context.Connection.GetDataReader(this.objectType, CommandInfo.Select, commands.Select(objectQuery));
            this.firstRead = true;
            if (this.data != null)
            {
                this.hasObjects = this.data.Read();
            }
            if (!this.hasObjects)
            {
                this.Close();
            }
        }
예제 #2
0
 internal ObjectHolder(Internals.Context context, SelectProcedure selectSP)
 {
     this.context  = context;
     this.type     = selectSP.ObjectType;
     this.selectSP = selectSP;
     // DBNull Bug-Fix by Gerrod Thomas (http://www.Gerrod.com)
     this.key = (selectSP.ParameterValue(0) is System.DBNull ? null : selectSP.ParameterValue(0));
 }
예제 #3
0
 internal ObjectHolder(Internals.Context context, Type type, object key)
 {
     this.context  = context;
     this.type     = type;
     this.selectSP = null;
     // DBNull Bug-Fix by Gerrod Thomas (http://www.Gerrod.com)
     this.key = (key is System.DBNull ? null : key);
 }
예제 #4
0
        internal ObjectReader(Internals.Context context, SelectProcedure selectProcedure, bool firstLevel)
        {
            this.context    = context;
            this.firstLevel = firstLevel;
            this.objectType = selectProcedure.ObjectType;
            this.pageIndex  = 1;
            this.hasEvents  = context.Mappings[this.objectType.ToString()].HasEvents;

            this.selectProcedure = selectProcedure;
            this.data            = context.Connection.GetDataReader(this.objectType, CommandInfo.Select, out this.command, selectProcedure.ProcedureName, selectProcedure.parameters);
            this.firstRead       = true;
            if (this.data != null)
            {
                this.hasObjects = this.data.Read();
            }
            if (!this.hasObjects)
            {
                this.Close();
            }
        }
예제 #5
0
        // Jeff Lanning ([email protected]): Added for OPath support.
        internal ObjectReader(Internals.Context context, CompiledQuery query, bool firstLevel, object[] parameters)
        {
            this.context    = context;
            this.firstLevel = firstLevel;
            this.objectType = query.ObjectType;
            this.pageIndex  = 1;
            this.hasEvents  = context.Mappings[this.objectType].HasEvents;

            this.data = context.Connection.GetDataReader(this.objectType, CommandInfo.Select, query, parameters);

            this.firstRead = true;
            if (this.data != null)
            {
                this.hasObjects = this.data.Read();
            }
            if (!this.hasObjects)
            {
                this.Close();
            }
        }
예제 #6
0
 internal ObjectList(Internals.Context context, SelectProcedure selectSP)
 {
     this.context  = context;
     this.type     = typeof(T);
     this.selectSP = selectSP;
 }
예제 #7
0
 internal ObjectList(Internals.Context context, ObjectQuery objectQuery)
 {
     this.context = context;
     this.type    = typeof(T);
     this.query   = objectQuery;
 }
예제 #8
0
 internal ObjectReader(Internals.Context context, SelectProcedure <T> selectProcedure, bool firstLevel)
     : base(context, selectProcedure, firstLevel)
 {
 }
예제 #9
0
 // Jeff Lanning ([email protected]): Added for OPath support.
 internal ObjectReader(Internals.Context context, CompiledQuery <T> query, bool firstLevel, object[] parameters)
     : base(context, query, firstLevel, parameters)
 {
 }
예제 #10
0
 internal ObjectList(Internals.Context context, ObjectSet objectSet)
 {
     this.context = context;
     this.type    = objectSet.ObjectType;
     this.list    = objectSet;
 }
예제 #11
0
 internal ObjectHolder(Internals.Context context, SelectProcedure <T> selectSP)
     : base(context, selectSP)
 {
 }
예제 #12
0
 internal ObjectHolder(Internals.Context context, object key)
     : base(context, typeof(T), key)
 {
 }
예제 #13
0
 internal ObjectList(Internals.Context context, Type objectType)
 {
     this.context = context;
     this.type    = objectType;
 }
예제 #14
0
 internal ObjectList(Internals.Context context, ObjectSet <T> objectSet)
 {
     this.context = context;
     this.type    = typeof(T);
     this.list    = objectSet;
 }
예제 #15
0
 internal ObjectReader(Internals.Context context, ObjectQuery <T> objectQuery, bool firstLevel)
     : base(context, objectQuery, firstLevel)
 {
 }
예제 #16
0
 internal ObjectList(Internals.Context context)
 {
     this.context = context;
     this.type    = typeof(T);
 }
예제 #17
0
 internal ObjectList(Internals.Context context, ObjectQuery objectQuery)
 {
     this.context = context;
     this.type    = objectQuery.ObjectType;
     this.query   = objectQuery;
 }