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