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();
            }
        }
Exemple #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));
 }
Exemple #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);
 }
        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();
            }
        }
        // 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();
            }
        }
 internal ObjectList(Internals.Context context, SelectProcedure selectSP)
 {
     this.context  = context;
     this.type     = typeof(T);
     this.selectSP = selectSP;
 }
 internal ObjectList(Internals.Context context, ObjectQuery objectQuery)
 {
     this.context = context;
     this.type    = typeof(T);
     this.query   = objectQuery;
 }
Exemple #8
0
 internal ObjectReader(Internals.Context context, SelectProcedure <T> selectProcedure, bool firstLevel)
     : base(context, selectProcedure, firstLevel)
 {
 }
Exemple #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)
 {
 }
Exemple #10
0
 internal ObjectList(Internals.Context context, ObjectSet objectSet)
 {
     this.context = context;
     this.type    = objectSet.ObjectType;
     this.list    = objectSet;
 }
 internal ObjectHolder(Internals.Context context, SelectProcedure <T> selectSP)
     : base(context, selectSP)
 {
 }
 internal ObjectHolder(Internals.Context context, object key)
     : base(context, typeof(T), key)
 {
 }
Exemple #13
0
 internal ObjectList(Internals.Context context, Type objectType)
 {
     this.context = context;
     this.type    = objectType;
 }
 internal ObjectList(Internals.Context context, ObjectSet <T> objectSet)
 {
     this.context = context;
     this.type    = typeof(T);
     this.list    = objectSet;
 }
Exemple #15
0
 internal ObjectReader(Internals.Context context, ObjectQuery <T> objectQuery, bool firstLevel)
     : base(context, objectQuery, firstLevel)
 {
 }
 internal ObjectList(Internals.Context context)
 {
     this.context = context;
     this.type    = typeof(T);
 }
Exemple #17
0
 internal ObjectList(Internals.Context context, ObjectQuery objectQuery)
 {
     this.context = context;
     this.type    = objectQuery.ObjectType;
     this.query   = objectQuery;
 }