Esempio n. 1
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);
		}
Esempio 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));
		}
Esempio n. 3
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();
		}
Esempio n. 4
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();
		}
Esempio n. 5
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();
		}
Esempio n. 6
0
 internal ObjectList(Internals.Context context, Type objectType)
 {
     this.context = context;
     this.type = objectType;
 }
Esempio n. 7
0
 internal ObjectList(Internals.Context context, ObjectSet objectSet)
 {
     this.context = context;
     this.type = objectSet.ObjectType;
     this.list = objectSet;
 }
Esempio n. 8
0
 internal ObjectList(Internals.Context context, SelectProcedure selectSP)
 {
     this.context = context;
     this.type = selectSP.ObjectType;
     this.selectSP = selectSP;
 }
Esempio n. 9
0
 internal ObjectList(Internals.Context context, ObjectQuery objectQuery)
 {
     this.context = context;
     this.type = objectQuery.ObjectType;
     this.query = objectQuery;
 }