private esProviderSpecificMetadata esOracle(string mapName)
		{
			if(!m_providerMetadataMaps.ContainsKey(mapName))
			{
				esProviderSpecificMetadata meta = new esProviderSpecificMetadata();	
				

				meta.AddTypeMap("EmployeeID", new esTypeMap("NUMBER", "System.Decimal"));
				meta.AddTypeMap("LastName", new esTypeMap("VARCHAR2", "System.String"));
				meta.AddTypeMap("FirstName", new esTypeMap("VARCHAR2", "System.String"));
				meta.AddTypeMap("Supervisor", new esTypeMap("NUMBER", "System.Decimal"));
				meta.AddTypeMap("Age", new esTypeMap("NUMBER", "System.Decimal"));
				meta["AutoKeyText"] = "seq_Employee";				
				meta.Catalog = "HIERARCHICAL";
				meta.Schema = "HIERARCHICAL";
				meta.Source = "Employee";
				meta.Destination = "Employee";
				
				meta.spInsert = "esEmployeeInsert";				
				meta.spUpdate = "esEmployeeUpdate";		
				meta.spDelete = "esEmployeeDelete";
				meta.spLoadAll = "esEmployeeLoadAll";
				meta.spLoadByPrimaryKey = "esEmployeeLoadByPK";
				
				m_providerMetadataMaps["esOracle"] = meta;
			}
			
			return m_providerMetadataMaps["esOracle"];
		}
		private esProviderSpecificMetadata esVistaDB4(string mapName)
		{
			if(!m_providerMetadataMaps.ContainsKey(mapName))
			{
				esProviderSpecificMetadata meta = new esProviderSpecificMetadata();	
				

				meta.AddTypeMap("ProductID", new esTypeMap("Int", "System.Int32"));
				meta.AddTypeMap("ProductName", new esTypeMap("VarChar", "System.String"));
				meta.AddTypeMap("UnitPrice", new esTypeMap("Money", "System.Decimal"));
				meta.AddTypeMap("Discontinued", new esTypeMap("Bit", "System.Boolean"));				
				meta.Catalog = "ForeignKeyTest.vdb4";
				
				meta.Source = "Product";
				meta.Destination = "Product";
				
				meta.spInsert = "proc_ProductInsert";				
				meta.spUpdate = "proc_ProductUpdate";		
				meta.spDelete = "proc_ProductDelete";
				meta.spLoadAll = "proc_ProductLoadAll";
				meta.spLoadByPrimaryKey = "proc_ProductLoadByPrimaryKey";
				
				m_providerMetadataMaps["esVistaDB4"] = meta;
			}
			
			return m_providerMetadataMaps["esVistaDB4"];
		}
		private esProviderSpecificMetadata esOracle(string mapName)
		{
			if(!m_providerMetadataMaps.ContainsKey(mapName))
			{
				esProviderSpecificMetadata meta = new esProviderSpecificMetadata();	
				

				meta.AddTypeMap("Id", new esTypeMap("NUMBER", "System.Decimal"));
				meta.AddTypeMap("Name", new esTypeMap("NVARCHAR2", "System.String"));
				meta.AddTypeMap("Parent", new esTypeMap("NUMBER", "System.Decimal"));
				meta.AddTypeMap("ConcurrencyCheck", new esTypeMap("NUMBER", "System.Decimal"));
				meta.AddTypeMap("DefaultTest", new esTypeMap("TIMESTAMP", "System.DateTime"));
				meta.AddTypeMap("ColumnA", new esTypeMap("NUMBER", "System.Decimal"));
				meta.AddTypeMap("ColumnB", new esTypeMap("NUMBER", "System.Decimal"));
				meta.AddTypeMap("ColumnAB", new esTypeMap("NUMBER", "System.Decimal"));
				meta["AutoKeyText"] = "CHILD_SEQ";				
				meta.Catalog = "ENTITYSPACES";
				meta.Schema = "ENTITYSPACES";
				meta.Source = "ConcurrencyTestChild";
				meta.Destination = "ConcurrencyTestChild";
				
				meta.spInsert = "esConcurrencyTestChildInsert";				
				meta.spUpdate = "esConcurrencyTestChildUpdate";		
				meta.spDelete = "esConcurrencyTestChildDelete";
				meta.spLoadAll = "esConcurrencyTestChildLoadAll";
				meta.spLoadByPrimaryKey = "esConcurrencyTestChildLoadByPK";
				
				m_providerMetadataMaps["esOracle"] = meta;
			}
			
			return m_providerMetadataMaps["esOracle"];
		}
		private esProviderSpecificMetadata esMySQL(string mapName)
		{
			if(!m_providerMetadataMaps.ContainsKey(mapName))
			{
				esProviderSpecificMetadata meta = new esProviderSpecificMetadata();	
				

				meta.AddTypeMap("TerritoryID", new esTypeMap("INT", "System.Int32"));
				meta.AddTypeMap("Description", new esTypeMap("VARCHAR", "System.String"));				
				meta.Catalog = "foreignkeytest";
				
				meta.Source = "territory";
				meta.Destination = "territory";
				
				meta.spInsert = "proc_territoryInsert";				
				meta.spUpdate = "proc_territoryUpdate";		
				meta.spDelete = "proc_territoryDelete";
				meta.spLoadAll = "proc_territoryLoadAll";
				meta.spLoadByPrimaryKey = "proc_territoryLoadByPrimaryKey";
				
				m_providerMetadataMaps["esMySQL"] = meta;
			}
			
			return m_providerMetadataMaps["esMySQL"];
		}
		private esProviderSpecificMetadata esSqlCe4(string mapName)
		{
			if(!m_providerMetadataMaps.ContainsKey(mapName))
			{
				esProviderSpecificMetadata meta = new esProviderSpecificMetadata();	
				

				meta.AddTypeMap("GroupID", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("GroupName", new esTypeMap("nvarchar", "System.String"));				
				meta.Catalog = "ForeignKeyTest.sdf";
				
				meta.Source = "CustomerGroup";
				meta.Destination = "CustomerGroup";
				
				meta.spInsert = "proc_CustomerGroupInsert";				
				meta.spUpdate = "proc_CustomerGroupUpdate";		
				meta.spDelete = "proc_CustomerGroupDelete";
				meta.spLoadAll = "proc_CustomerGroupLoadAll";
				meta.spLoadByPrimaryKey = "proc_CustomerGroupLoadByPrimaryKey";
				
				m_providerMetadataMaps["esSqlCe4"] = meta;
			}
			
			return m_providerMetadataMaps["esSqlCe4"];
		}
		private esProviderSpecificMetadata esAccess(string mapName)
		{
			if(!m_providerMetadataMaps.ContainsKey(mapName))
			{
				esProviderSpecificMetadata meta = new esProviderSpecificMetadata();	
				

				meta.AddTypeMap("ProductID", new esTypeMap("Long", "System.Int32"));
				meta.AddTypeMap("ProductName", new esTypeMap("Text", "System.String"));
				meta.AddTypeMap("SupplierID", new esTypeMap("Long", "System.Int32"));
				meta.AddTypeMap("CategoryID", new esTypeMap("Long", "System.Int32"));
				meta.AddTypeMap("QuantityPerUnit", new esTypeMap("Text", "System.String"));
				meta.AddTypeMap("UnitPrice", new esTypeMap("Currency", "System.Decimal"));
				meta.AddTypeMap("UnitsInStock", new esTypeMap("Integer", "System.Int16"));
				meta.AddTypeMap("UnitsOnOrder", new esTypeMap("Integer", "System.Int16"));
				meta.AddTypeMap("ReorderLevel", new esTypeMap("Integer", "System.Int16"));
				meta.AddTypeMap("Discontinued", new esTypeMap("Yes/No", "System.Boolean"));				
				meta.Catalog = "Northwind.mdb";
				
				meta.Source = "Products";
				meta.Destination = "Products";
				
				meta.spInsert = "proc_ProductsInsert";				
				meta.spUpdate = "proc_ProductsUpdate";		
				meta.spDelete = "proc_ProductsDelete";
				meta.spLoadAll = "proc_ProductsLoadAll";
				meta.spLoadByPrimaryKey = "proc_ProductsLoadByPrimaryKey";
				
				m_providerMetadataMaps["esAccess"] = meta;
			}
			
			return m_providerMetadataMaps["esAccess"];
		}
		private esProviderSpecificMetadata esOracle(string mapName)
		{
			if(!m_providerMetadataMaps.ContainsKey(mapName))
			{
				esProviderSpecificMetadata meta = new esProviderSpecificMetadata();	
				

				meta.AddTypeMap("OrderID", new esTypeMap("NUMBER", "System.Decimal"));
				meta.AddTypeMap("ProductID", new esTypeMap("NUMBER", "System.Decimal"));
				meta.AddTypeMap("UnitPrice", new esTypeMap("NUMBER", "System.Decimal"));
				meta.AddTypeMap("Quantity", new esTypeMap("NUMBER", "System.Decimal"));
				meta.AddTypeMap("Discount", new esTypeMap("NUMBER", "System.Decimal"));				
				meta.Catalog = "HIERARCHICAL";
				meta.Schema = "HIERARCHICAL";
				meta.Source = "OrderItem";
				meta.Destination = "OrderItem";
				
				meta.spInsert = "esOrderItemInsert";				
				meta.spUpdate = "esOrderItemUpdate";		
				meta.spDelete = "esOrderItemDelete";
				meta.spLoadAll = "esOrderItemLoadAll";
				meta.spLoadByPrimaryKey = "esOrderItemLoadByPK";
				
				m_providerMetadataMaps["esOracle"] = meta;
			}
			
			return m_providerMetadataMaps["esOracle"];
		}
		private esProviderSpecificMetadata esSQLite(string mapName)
		{
			if(!m_providerMetadataMaps.ContainsKey(mapName))
			{
				esProviderSpecificMetadata meta = new esProviderSpecificMetadata();	
				

				meta.AddTypeMap("OrderID", new esTypeMap("integer", "System.Int32"));
				meta.AddTypeMap("CustID", new esTypeMap("char", "System.String"));
				meta.AddTypeMap("CustSub", new esTypeMap("char", "System.String"));
				meta.AddTypeMap("PlacedBy", new esTypeMap("varchar", "System.String"));
				meta.AddTypeMap("OrderDate", new esTypeMap("datetime", "System.DateTime"));
				meta.AddTypeMap("ConcurrencyCheck", new esTypeMap("blob", "System.Byte[]"));
				meta.AddTypeMap("EmployeeID", new esTypeMap("integer", "System.Int32"));				
				meta.Catalog = "main";
				
				meta.Source = "Order";
				meta.Destination = "Order";
				
				meta.spInsert = "proc_OrderInsert";				
				meta.spUpdate = "proc_OrderUpdate";		
				meta.spDelete = "proc_OrderDelete";
				meta.spLoadAll = "proc_OrderLoadAll";
				meta.spLoadByPrimaryKey = "proc_OrderLoadByPrimaryKey";
				
				m_providerMetadataMaps["esSQLite"] = meta;
			}
			
			return m_providerMetadataMaps["esSQLite"];
		}
		private esProviderSpecificMetadata esAccess(string mapName)
		{
			if(!m_providerMetadataMaps.ContainsKey(mapName))
			{
				esProviderSpecificMetadata meta = new esProviderSpecificMetadata();	
				

				meta.AddTypeMap("TerritoryID", new esTypeMap("Long", "System.Int32"));
				meta.AddTypeMap("Notes", new esTypeMap("Text", "System.String"));				
				meta.Catalog = "ForeignKeyTest.mdb";
				
				meta.Source = "TerritoryEx";
				meta.Destination = "TerritoryEx";
				
				meta.spInsert = "proc_TerritoryExInsert";				
				meta.spUpdate = "proc_TerritoryExUpdate";		
				meta.spDelete = "proc_TerritoryExDelete";
				meta.spLoadAll = "proc_TerritoryExLoadAll";
				meta.spLoadByPrimaryKey = "proc_TerritoryExLoadByPrimaryKey";
				
				m_providerMetadataMaps["esAccess"] = meta;
			}
			
			return m_providerMetadataMaps["esAccess"];
		}
		private esProviderSpecificMetadata esSqlCe4(string mapName)
		{
			if(!m_providerMetadataMaps.ContainsKey(mapName))
			{
				esProviderSpecificMetadata meta = new esProviderSpecificMetadata();	
				

				meta.AddTypeMap("ProductID", new esTypeMap("int", "System.Int32"));
				meta.AddTypeMap("SupplierID", new esTypeMap("int", "System.Int32"));
				meta.AddTypeMap("CategoryID", new esTypeMap("int", "System.Int32"));
				meta.AddTypeMap("ProductName", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("EnglishName", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("QuantityPerUnit", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("UnitPrice", new esTypeMap("money", "System.Decimal"));
				meta.AddTypeMap("UnitsInStock", new esTypeMap("smallint", "System.Int16"));
				meta.AddTypeMap("UnitsOnOrder", new esTypeMap("smallint", "System.Int16"));
				meta.AddTypeMap("ReorderLevel", new esTypeMap("smallint", "System.Int16"));
				meta.AddTypeMap("Discontinued", new esTypeMap("bit", "System.Boolean"));				
				meta.Catalog = "Northwind.sdf";
				
				meta.Source = "Products";
				meta.Destination = "Products";
				
				meta.spInsert = "proc_ProductsInsert";				
				meta.spUpdate = "proc_ProductsUpdate";		
				meta.spDelete = "proc_ProductsDelete";
				meta.spLoadAll = "proc_ProductsLoadAll";
				meta.spLoadByPrimaryKey = "proc_ProductsLoadByPrimaryKey";
				
				m_providerMetadataMaps["esSqlCe4"] = meta;
			}
			
			return m_providerMetadataMaps["esSqlCe4"];
		}
		private esProviderSpecificMetadata esMySQL(string mapName)
		{
			if(!m_providerMetadataMaps.ContainsKey(mapName))
			{
				esProviderSpecificMetadata meta = new esProviderSpecificMetadata();	
				

				meta.AddTypeMap("EmployeeID", new esTypeMap("INT", "System.Int32"));
				meta.AddTypeMap("ReferredID", new esTypeMap("INT", "System.Int32"));				
				meta.Catalog = "foreignkeytest";
				
				meta.Source = "referredemployee";
				meta.Destination = "referredemployee";
				
				meta.spInsert = "proc_referredemployeeInsert";				
				meta.spUpdate = "proc_referredemployeeUpdate";		
				meta.spDelete = "proc_referredemployeeDelete";
				meta.spLoadAll = "proc_referredemployeeLoadAll";
				meta.spLoadByPrimaryKey = "proc_referredemployeeLoadByPrimaryKey";
				
				m_providerMetadataMaps["esMySQL"] = meta;
			}
			
			return m_providerMetadataMaps["esMySQL"];
		}
		private esProviderSpecificMetadata esSybase(string mapName)
		{
			if(!m_providerMetadataMaps.ContainsKey(mapName))
			{
				esProviderSpecificMetadata meta = new esProviderSpecificMetadata();	
				

				meta.AddTypeMap("SupplierID", new esTypeMap("integer", "System.Int32"));
				meta.AddTypeMap("CompanyName", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("ContactName", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("ContactTitle", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("Address", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("City", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("Region", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("PostalCode", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("Country", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("Phone", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("Fax", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("HomePage", new esTypeMap("long nvarchar", "System.String"));				
				meta.Catalog = "Northwind";
				meta.Schema = "DBA";
				meta.Source = "Suppliers";
				meta.Destination = "Suppliers";
				
				meta.spInsert = "proc_SuppliersInsert";				
				meta.spUpdate = "proc_SuppliersUpdate";		
				meta.spDelete = "proc_SuppliersDelete";
				meta.spLoadAll = "proc_SuppliersLoadAll";
				meta.spLoadByPrimaryKey = "proc_SuppliersLoadByPrimaryKey";
				
				m_providerMetadataMaps["esSybase"] = meta;
			}
			
			return m_providerMetadataMaps["esSybase"];
		}
		private esProviderSpecificMetadata esOracle(string mapName)
		{
			if(!m_providerMetadataMaps.ContainsKey(mapName))
			{
				esProviderSpecificMetadata meta = new esProviderSpecificMetadata();	
				

				meta.AddTypeMap("TestId", new esTypeMap("NUMBER", "System.Decimal"));
				meta.AddTypeMap("DefaultNotNullInt", new esTypeMap("NUMBER", "System.Decimal"));
				meta.AddTypeMap("DefaultNotNullBool", new esTypeMap("NUMBER", "System.Decimal"));
				meta["AutoKeyText"] = "DEFAULTTEST_SEQ";				
				meta.Catalog = "ENTITYSPACES";
				meta.Schema = "ENTITYSPACES";
				meta.Source = "DefaultTest";
				meta.Destination = "DefaultTest";
				
				meta.spInsert = "esDefaultTestInsert";				
				meta.spUpdate = "esDefaultTestUpdate";		
				meta.spDelete = "esDefaultTestDelete";
				meta.spLoadAll = "esDefaultTestLoadAll";
				meta.spLoadByPrimaryKey = "esDefaultTestLoadByPK";
				
				m_providerMetadataMaps["esOracle"] = meta;
			}
			
			return m_providerMetadataMaps["esOracle"];
		}
		private esProviderSpecificMetadata esVistaDB4(string mapName)
		{
			if(!m_providerMetadataMaps.ContainsKey(mapName))
			{
				esProviderSpecificMetadata meta = new esProviderSpecificMetadata();	
				

				meta.AddTypeMap("OrderID", new esTypeMap("Int", "System.Int32"));
				meta.AddTypeMap("ProductID", new esTypeMap("Int", "System.Int32"));
				meta.AddTypeMap("UnitPrice", new esTypeMap("Money", "System.Decimal"));
				meta.AddTypeMap("Quantity", new esTypeMap("SmallInt", "System.Int16"));
				meta.AddTypeMap("Discount", new esTypeMap("Real", "System.Single"));				
				meta.Catalog = "ForeignKeyTest.vdb4";
				
				meta.Source = "OrderItem";
				meta.Destination = "OrderItem";
				
				meta.spInsert = "proc_OrderItemInsert";				
				meta.spUpdate = "proc_OrderItemUpdate";		
				meta.spDelete = "proc_OrderItemDelete";
				meta.spLoadAll = "proc_OrderItemLoadAll";
				meta.spLoadByPrimaryKey = "proc_OrderItemLoadByPrimaryKey";
				
				m_providerMetadataMaps["esVistaDB4"] = meta;
			}
			
			return m_providerMetadataMaps["esVistaDB4"];
		}
		private esProviderSpecificMetadata esSqlCe(string mapName)
		{
			if(!m_providerMetadataMaps.ContainsKey(mapName))
			{
				esProviderSpecificMetadata meta = new esProviderSpecificMetadata();	
				

				meta.AddTypeMap("Id", new esTypeMap("int", "System.Int32"));
				meta.AddTypeMap("DepartmentID", new esTypeMap("int", "System.Int32"));
				meta.AddTypeMap("FirstName", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("LastName", new esTypeMap("nvarchar", "System.String"));
				meta.AddTypeMap("Age", new esTypeMap("int", "System.Int32"));
				meta.AddTypeMap("HireDate", new esTypeMap("datetime", "System.DateTime"));
				meta.AddTypeMap("Salary", new esTypeMap("numeric", "System.Decimal"));
				meta.AddTypeMap("IsActive", new esTypeMap("bit", "System.Boolean"));				
				meta.Catalog = "AggregateDb.sdf";
				
				meta.Source = "AggregateTest";
				meta.Destination = "AggregateTest";
				
				meta.spInsert = "proc_AggregateTestInsert";				
				meta.spUpdate = "proc_AggregateTestUpdate";		
				meta.spDelete = "proc_AggregateTestDelete";
				meta.spLoadAll = "proc_AggregateTestLoadAll";
				meta.spLoadByPrimaryKey = "proc_AggregateTestLoadByPrimaryKey";
				
				m_providerMetadataMaps["esSqlCe"] = meta;
			}
			
			return m_providerMetadataMaps["esSqlCe"];
		}
		private esProviderSpecificMetadata esVistaDB4(string mapName)
		{
			if(!m_providerMetadataMaps.ContainsKey(mapName))
			{
				esProviderSpecificMetadata meta = new esProviderSpecificMetadata();	
				

				meta.AddTypeMap("ShipperID", new esTypeMap("Int", "System.Int32"));
				meta.AddTypeMap("CompanyName", new esTypeMap("NVarChar", "System.String"));
				meta.AddTypeMap("Phone", new esTypeMap("NVarChar", "System.String"));				
				meta.Catalog = "Northwind.vdb4";
				
				meta.Source = "Shippers";
				meta.Destination = "Shippers";
				
				meta.spInsert = "proc_ShippersInsert";				
				meta.spUpdate = "proc_ShippersUpdate";		
				meta.spDelete = "proc_ShippersDelete";
				meta.spLoadAll = "proc_ShippersLoadAll";
				meta.spLoadByPrimaryKey = "proc_ShippersLoadByPrimaryKey";
				
				m_providerMetadataMaps["esVistaDB4"] = meta;
			}
			
			return m_providerMetadataMaps["esVistaDB4"];
		}
		private esProviderSpecificMetadata esPgsql(string mapName)
		{
			if(!m_providerMetadataMaps.ContainsKey(mapName))
			{
				esProviderSpecificMetadata meta = new esProviderSpecificMetadata();	
				

				meta.AddTypeMap("CustomerID", new esTypeMap("bpchar", "System.String"));
				meta.AddTypeMap("CustomerSub", new esTypeMap("bpchar", "System.String"));
				meta.AddTypeMap("CustomerName", new esTypeMap("varchar", "System.String"));
				meta.AddTypeMap("DateAdded", new esTypeMap("timestamp", "System.DateTime"));
				meta.AddTypeMap("Active", new esTypeMap("bool", "System.Boolean"));
				meta.AddTypeMap("ConcurrencyCheck", new esTypeMap("bytea", "System.Byte[]"));
				meta.AddTypeMap("Manager", new esTypeMap("int8", "System.Int64"));
				meta.AddTypeMap("StaffAssigned", new esTypeMap("int8", "System.Int64"));
				meta.AddTypeMap("UniqueID", new esTypeMap("bpchar", "System.String"));
				meta.AddTypeMap("Notes", new esTypeMap("text", "System.String"));
				meta.AddTypeMap("CreditLimit", new esTypeMap("numeric", "System.Decimal"));
				meta.AddTypeMap("Discount", new esTypeMap("numeric", "System.Decimal"));				
				meta.Catalog = "ForeignKeyTest";
				meta.Schema = "public";
				meta.Source = "Customer";
				meta.Destination = "Customer";
				
				meta.spInsert = "proc_CustomerInsert";				
				meta.spUpdate = "proc_CustomerUpdate";		
				meta.spDelete = "proc_CustomerDelete";
				meta.spLoadAll = "proc_CustomerLoadAll";
				meta.spLoadByPrimaryKey = "proc_CustomerLoadByPrimaryKey";
				
				m_providerMetadataMaps["esPgsql"] = meta;
			}
			
			return m_providerMetadataMaps["esPgsql"];
		}
		private esProviderSpecificMetadata esPgsql(string mapName)
		{
			if(!m_providerMetadataMaps.ContainsKey(mapName))
			{
				esProviderSpecificMetadata meta = new esProviderSpecificMetadata();	
				

				meta.AddTypeMap("EmployeeID", new esTypeMap("int8", "System.Int64"));
				meta.AddTypeMap("ReferredID", new esTypeMap("int8", "System.Int64"));				
				meta.Catalog = "ForeignKeyTest";
				meta.Schema = "public";
				meta.Source = "ReferredEmployee";
				meta.Destination = "ReferredEmployee";
				
				meta.spInsert = "proc_ReferredEmployeeInsert";				
				meta.spUpdate = "proc_ReferredEmployeeUpdate";		
				meta.spDelete = "proc_ReferredEmployeeDelete";
				meta.spLoadAll = "proc_ReferredEmployeeLoadAll";
				meta.spLoadByPrimaryKey = "proc_ReferredEmployeeLoadByPrimaryKey";
				
				m_providerMetadataMaps["esPgsql"] = meta;
			}
			
			return m_providerMetadataMaps["esPgsql"];
		}
		private esProviderSpecificMetadata esSybase(string mapName)
		{
			if(!m_providerMetadataMaps.ContainsKey(mapName))
			{
				esProviderSpecificMetadata meta = new esProviderSpecificMetadata();	
				

				meta.AddTypeMap("FullName", new esTypeMap("varchar", "System.String"));
				meta.AddTypeMap("DepartmentID", new esTypeMap("integer", "System.Int32"));
				meta.AddTypeMap("HireDate", new esTypeMap("timestamp", "System.DateTime"));
				meta.AddTypeMap("Salary", new esTypeMap("numeric", "System.Decimal"));
				meta.AddTypeMap("IsActive", new esTypeMap("bit", "System.Boolean"));				
				meta.Catalog = "AggregateDB";
				meta.Schema = "DBA";
				meta.Source = "FullNameView";
				meta.Destination = "FullNameView";
				
				meta.spInsert = "proc_FullNameViewInsert";				
				meta.spUpdate = "proc_FullNameViewUpdate";		
				meta.spDelete = "proc_FullNameViewDelete";
				meta.spLoadAll = "proc_FullNameViewLoadAll";
				meta.spLoadByPrimaryKey = "proc_FullNameViewLoadByPrimaryKey";
				
				m_providerMetadataMaps["esSybase"] = meta;
			}
			
			return m_providerMetadataMaps["esSybase"];
		}
		private esProviderSpecificMetadata esSybase(string mapName)
		{
			if(!m_providerMetadataMaps.ContainsKey(mapName))
			{
				esProviderSpecificMetadata meta = new esProviderSpecificMetadata();	
				

				meta.AddTypeMap("CustomerID", new esTypeMap("nchar", "System.String"));
				meta.AddTypeMap("CustomerTypeID", new esTypeMap("nchar", "System.String"));				
				meta.Catalog = "Northwind";
				meta.Schema = "DBA";
				meta.Source = "CustomerCustomerDemo";
				meta.Destination = "CustomerCustomerDemo";
				
				meta.spInsert = "proc_CustomerCustomerDemoInsert";				
				meta.spUpdate = "proc_CustomerCustomerDemoUpdate";		
				meta.spDelete = "proc_CustomerCustomerDemoDelete";
				meta.spLoadAll = "proc_CustomerCustomerDemoLoadAll";
				meta.spLoadByPrimaryKey = "proc_CustomerCustomerDemoLoadByPrimaryKey";
				
				m_providerMetadataMaps["esSybase"] = meta;
			}
			
			return m_providerMetadataMaps["esSybase"];
		}
		private esProviderSpecificMetadata esSQLite(string mapName)
		{
			if(!m_providerMetadataMaps.ContainsKey(mapName))
			{
				esProviderSpecificMetadata meta = new esProviderSpecificMetadata();	
				

				meta.AddTypeMap("ProductID", new esTypeMap("integer", "System.Int32"));
				meta.AddTypeMap("ProductName", new esTypeMap("varchar", "System.String"));
				meta.AddTypeMap("UnitPrice", new esTypeMap("numeric", "System.Decimal"));
				meta.AddTypeMap("Discontinued", new esTypeMap("bit", "System.Boolean"));				
				meta.Catalog = "main";
				
				meta.Source = "Product";
				meta.Destination = "Product";
				
				meta.spInsert = "proc_ProductInsert";				
				meta.spUpdate = "proc_ProductUpdate";		
				meta.spDelete = "proc_ProductDelete";
				meta.spLoadAll = "proc_ProductLoadAll";
				meta.spLoadByPrimaryKey = "proc_ProductLoadByPrimaryKey";
				
				m_providerMetadataMaps["esSQLite"] = meta;
			}
			
			return m_providerMetadataMaps["esSQLite"];
		}
		private esProviderSpecificMetadata esAccess(string mapName)
		{
			if(!m_providerMetadataMaps.ContainsKey(mapName))
			{
				esProviderSpecificMetadata meta = new esProviderSpecificMetadata();	
				

				meta.AddTypeMap("ProductID", new esTypeMap("Long", "System.Int32"));
				meta.AddTypeMap("ProductName", new esTypeMap("Text", "System.String"));
				meta.AddTypeMap("UnitPrice", new esTypeMap("Currency", "System.Decimal"));
				meta.AddTypeMap("Discontinued", new esTypeMap("Yes/No", "System.Boolean"));				
				meta.Catalog = "ForeignKeyTest.mdb";
				
				meta.Source = "Product";
				meta.Destination = "Product";
				
				meta.spInsert = "proc_ProductInsert";				
				meta.spUpdate = "proc_ProductUpdate";		
				meta.spDelete = "proc_ProductDelete";
				meta.spLoadAll = "proc_ProductLoadAll";
				meta.spLoadByPrimaryKey = "proc_ProductLoadByPrimaryKey";
				
				m_providerMetadataMaps["esAccess"] = meta;
			}
			
			return m_providerMetadataMaps["esAccess"];
		}
		private esProviderSpecificMetadata esVistaDB4(string mapName)
		{
			if(!m_providerMetadataMaps.ContainsKey(mapName))
			{
				esProviderSpecificMetadata meta = new esProviderSpecificMetadata();	
				

				meta.AddTypeMap("Id", new esTypeMap("Char", "System.String"));
				meta.AddTypeMap("Name", new esTypeMap("VarChar", "System.String"));
				meta.AddTypeMap("ConcurrencyCheck", new esTypeMap("BigInt", "System.Int64"));				
				meta.Catalog = "AggregateDb.vdb4";
				
				meta.Source = "ConcurrencyTest";
				meta.Destination = "ConcurrencyTest";
				
				meta.spInsert = "proc_ConcurrencyTestInsert";				
				meta.spUpdate = "proc_ConcurrencyTestUpdate";		
				meta.spDelete = "proc_ConcurrencyTestDelete";
				meta.spLoadAll = "proc_ConcurrencyTestLoadAll";
				meta.spLoadByPrimaryKey = "proc_ConcurrencyTestLoadByPrimaryKey";
				
				m_providerMetadataMaps["esVistaDB4"] = meta;
			}
			
			return m_providerMetadataMaps["esVistaDB4"];
		}
		private esProviderSpecificMetadata esSybase(string mapName)
		{
			if(!m_providerMetadataMaps.ContainsKey(mapName))
			{
				esProviderSpecificMetadata meta = new esProviderSpecificMetadata();	
				

				meta.AddTypeMap("OrderID", new esTypeMap("integer", "System.Int32"));
				meta.AddTypeMap("ProductID", new esTypeMap("integer", "System.Int32"));
				meta.AddTypeMap("UnitPrice", new esTypeMap("numeric", "System.Decimal"));
				meta.AddTypeMap("Quantity", new esTypeMap("smallint", "System.Int16"));
				meta.AddTypeMap("Discount", new esTypeMap("float", "System.Single"));				
				meta.Catalog = "ForeignKeyTest";
				meta.Schema = "DBA";
				meta.Source = "OrderItem";
				meta.Destination = "OrderItem";
				
				meta.spInsert = "proc_OrderItemInsert";				
				meta.spUpdate = "proc_OrderItemUpdate";		
				meta.spDelete = "proc_OrderItemDelete";
				meta.spLoadAll = "proc_OrderItemLoadAll";
				meta.spLoadByPrimaryKey = "proc_OrderItemLoadByPrimaryKey";
				
				m_providerMetadataMaps["esSybase"] = meta;
			}
			
			return m_providerMetadataMaps["esSybase"];
		}
		private esProviderSpecificMetadata esSQLite(string mapName)
		{
			if(!m_providerMetadataMaps.ContainsKey(mapName))
			{
				esProviderSpecificMetadata meta = new esProviderSpecificMetadata();	
				

				meta.AddTypeMap("Id", new esTypeMap("integer", "System.Int32"));
				meta.AddTypeMap("Name", new esTypeMap("varchar", "System.String"));
				meta.AddTypeMap("Parent", new esTypeMap("integer", "System.Int32"));
				meta.AddTypeMap("ConcurrencyCheck", new esTypeMap("integer", "System.Int32"));
				meta.AddTypeMap("DefaultTest", new esTypeMap("datetime", "System.DateTime"));
				meta.AddTypeMap("ColumnA", new esTypeMap("integer", "System.Int32"));
				meta.AddTypeMap("ColumnB", new esTypeMap("integer", "System.Int32"));
				meta.AddTypeMap("ComputedAB", new esTypeMap("integer", "System.Int32"));				
				meta.Catalog = "main";
				
				meta.Source = "ConcurrencyTestChild";
				meta.Destination = "ConcurrencyTestChild";
				
				meta.spInsert = "proc_ConcurrencyTestChildInsert";				
				meta.spUpdate = "proc_ConcurrencyTestChildUpdate";		
				meta.spDelete = "proc_ConcurrencyTestChildDelete";
				meta.spLoadAll = "proc_ConcurrencyTestChildLoadAll";
				meta.spLoadByPrimaryKey = "proc_ConcurrencyTestChildLoadByPrimaryKey";
				
				m_providerMetadataMaps["esSQLite"] = meta;
			}
			
			return m_providerMetadataMaps["esSQLite"];
		}
		private esProviderSpecificMetadata esSqlCe4(string mapName)
		{
			if(!m_providerMetadataMaps.ContainsKey(mapName))
			{
				esProviderSpecificMetadata meta = new esProviderSpecificMetadata();	
				

				meta.AddTypeMap("TerritoryID", new esTypeMap("int", "System.Int32"));
				meta.AddTypeMap("Description", new esTypeMap("nvarchar", "System.String"));				
				meta.Catalog = "ForeignKeyTest.sdf";
				
				meta.Source = "Territory";
				meta.Destination = "Territory";
				
				meta.spInsert = "proc_TerritoryInsert";				
				meta.spUpdate = "proc_TerritoryUpdate";		
				meta.spDelete = "proc_TerritoryDelete";
				meta.spLoadAll = "proc_TerritoryLoadAll";
				meta.spLoadByPrimaryKey = "proc_TerritoryLoadByPrimaryKey";
				
				m_providerMetadataMaps["esSqlCe4"] = meta;
			}
			
			return m_providerMetadataMaps["esSqlCe4"];
		}
		private esProviderSpecificMetadata esMySQL(string mapName)
		{
			if(!m_providerMetadataMaps.ContainsKey(mapName))
			{
				esProviderSpecificMetadata meta = new esProviderSpecificMetadata();	
				

				meta.AddTypeMap("OrderID", new esTypeMap("INT", "System.Int32"));
				meta.AddTypeMap("ProductID", new esTypeMap("INT", "System.Int32"));
				meta.AddTypeMap("UnitPrice", new esTypeMap("DECIMAL", "System.Decimal"));
				meta.AddTypeMap("Quantity", new esTypeMap("SMALLINT", "System.Int16"));
				meta.AddTypeMap("Discount", new esTypeMap("DOUBLE", "System.Double"));				
				meta.Catalog = "northwind";
				
				meta.Source = "order details";
				meta.Destination = "order details";
				
				meta.spInsert = "proc_order detailsInsert";				
				meta.spUpdate = "proc_order detailsUpdate";		
				meta.spDelete = "proc_order detailsDelete";
				meta.spLoadAll = "proc_order detailsLoadAll";
				meta.spLoadByPrimaryKey = "proc_order detailsLoadByPrimaryKey";
				
				m_providerMetadataMaps["esMySQL"] = meta;
			}
			
			return m_providerMetadataMaps["esMySQL"];
		}
		private esProviderSpecificMetadata esOracle(string mapName)
		{
			if(!m_providerMetadataMaps.ContainsKey(mapName))
			{
				esProviderSpecificMetadata meta = new esProviderSpecificMetadata();	
				

				meta.AddTypeMap("OrderID", new esTypeMap("NUMBER", "System.Decimal"));
				meta.AddTypeMap("CustID", new esTypeMap("CHAR", "System.String"));
				meta.AddTypeMap("CustSub", new esTypeMap("CHAR", "System.String"));
				meta.AddTypeMap("PlacedBy", new esTypeMap("VARCHAR2", "System.String"));
				meta.AddTypeMap("OrderDate", new esTypeMap("TIMESTAMP", "System.DateTime"));
				meta.AddTypeMap("ConcurrencyCheck", new esTypeMap("NUMBER", "System.Decimal"));
				meta.AddTypeMap("EmployeeID", new esTypeMap("NUMBER", "System.Decimal"));
				meta["AutoKeyText"] = "seq_Order";				
				meta.Catalog = "HIERARCHICAL";
				meta.Schema = "HIERARCHICAL";
				meta.Source = "Order";
				meta.Destination = "Order";
				
				meta.spInsert = "esOrderInsert";				
				meta.spUpdate = "esOrderUpdate";		
				meta.spDelete = "esOrderDelete";
				meta.spLoadAll = "esOrderLoadAll";
				meta.spLoadByPrimaryKey = "esOrderLoadByPK";
				
				m_providerMetadataMaps["esOracle"] = meta;
			}
			
			return m_providerMetadataMaps["esOracle"];
		}
		private esProviderSpecificMetadata esOracle(string mapName)
		{
			if(!m_providerMetadataMaps.ContainsKey(mapName))
			{
				esProviderSpecificMetadata meta = new esProviderSpecificMetadata();	
				

				meta.AddTypeMap("Id", new esTypeMap("VARCHAR2", "System.String"));
				meta.AddTypeMap("XmlColumn", new esTypeMap("XMLTYPE", "System.String"));				
				meta.Catalog = "ENTITYSPACES";
				meta.Schema = "ENTITYSPACES";
				meta.Source = "OracleXmlTest";
				meta.Destination = "OracleXmlTest";
				
				meta.spInsert = "esOracleXmlTestInsert";				
				meta.spUpdate = "esOracleXmlTestUpdate";		
				meta.spDelete = "esOracleXmlTestDelete";
				meta.spLoadAll = "esOracleXmlTestLoadAll";
				meta.spLoadByPrimaryKey = "esOracleXmlTestLoadByPK";
				
				m_providerMetadataMaps["esOracle"] = meta;
			}
			
			return m_providerMetadataMaps["esOracle"];
		}
		private esProviderSpecificMetadata esMySQL(string mapName)
		{
			if(!m_providerMetadataMaps.ContainsKey(mapName))
			{
				esProviderSpecificMetadata meta = new esProviderSpecificMetadata();	
				

				meta.AddTypeMap("Id", new esTypeMap("CHAR", "System.String"));
				meta.AddTypeMap("Name", new esTypeMap("VARCHAR", "System.String"));
				meta.AddTypeMap("ConcurrencyCheck", new esTypeMap("BIGINT", "System.Int64"));				
				meta.Catalog = "aggregatedb";
				
				meta.Source = "concurrencytest";
				meta.Destination = "concurrencytest";
				
				meta.spInsert = "proc_concurrencytestInsert";				
				meta.spUpdate = "proc_concurrencytestUpdate";		
				meta.spDelete = "proc_concurrencytestDelete";
				meta.spLoadAll = "proc_concurrencytestLoadAll";
				meta.spLoadByPrimaryKey = "proc_concurrencytestLoadByPrimaryKey";
				
				m_providerMetadataMaps["esMySQL"] = meta;
			}
			
			return m_providerMetadataMaps["esMySQL"];
		}
        /// <summary>
        /// This initializes the esDataRequest for the query.
        /// </summary>
        /// <param name="request">The request to populate.</param>
        protected void PopulateRequest(esDataRequest request)
        {
            IMetadata meta = this.Meta;

            esConnection conn = this.es2.Connection;
            esProviderSpecificMetadata providerMetadata = meta.GetProviderMetadata(conn.ProviderMetadataKey);

            IDynamicQuerySerializableInternal iQuery = this as IDynamicQuerySerializableInternal;

            if ((this.queries != null && this.queries.Count > 0) || iQuery.InternalSetOperations != null)
            {
                AssignProviderMetadata(this, new List <esDynamicQuerySerializable>());
            }

            string catalog = conn.Catalog;
            string schema  = conn.Schema;

            iData.Catalog          = catalog;
            iData.Schema           = schema;
            iData.DataID           = meta.DataID;
            iData.ProviderMetadata = providerMetadata;
            iData.Columns          = meta.Columns;

            request.ConnectionString = conn.ConnectionString;
            request.CommandTimeout   = conn.CommandTimeout;
            request.QueryType        = esQueryType.DynamicQuery;
            request.DynamicQuery     = this;
            request.DataID           = meta.DataID;
            request.ProviderMetadata = providerMetadata;

            request.Catalog = catalog;
            request.Schema  = schema;
            request.Columns = meta.Columns;

            if (this.m_selectAll)
            {
                _selectAll();
            }

            if (es.QuerySource == null || es.QuerySource.Length == 0)
            {
                es.QuerySource = providerMetadata.Source;
            }
        }
        /// <summary>
        ///
        /// </summary>
        private void AssignProviderMetadata(esDynamicQuerySerializable query, List <esDynamicQuerySerializable> beenThere)
        {
            if (beenThere.Contains(query))
            {
                return;
            }

            beenThere.Add(query);

            esDynamicQuery theQuery = query as esDynamicQuery;
            IDynamicQuerySerializableInternal iQuery = query as IDynamicQuerySerializableInternal;

            if (theQuery != null)
            {
                esConnection conn = theQuery.es2.Connection;

                if (iQuery.ProviderMetadata == null)
                {
                    esProviderSpecificMetadata providerMetadata = theQuery.Meta.GetProviderMetadata(conn.ProviderMetadataKey);
                    iQuery.DataID           = theQuery.Meta.DataID;
                    iQuery.Columns          = theQuery.Meta.Columns;
                    iQuery.ProviderMetadata = providerMetadata;
                }

                iQuery.Catalog = conn.Catalog;
                iQuery.Schema  = conn.Schema;
            }

            // This code is for proxies as they are unable to work with column and provider metadata
            // until serialized back to the server
            if (iQuery.SelectAll)
            {
                foreach (esColumnMetadata col in (esColumnMetadataCollection)iQuery.Columns)
                {
                    esQueryItem item = new esQueryItem(this, col.Name, col.esType);
                    query.Select(item);
                }
            }
            else
            {
                List <esQueryItem> columns = iQuery.SelectAllExcept;

                if (columns != null)
                {
                    foreach (esColumnMetadata col in (esColumnMetadataCollection)iQuery.Columns)
                    {
                        bool found = false;

                        for (int i = 0; i < columns.Count; i++)
                        {
                            if (col.Name == (string)columns[i])
                            {
                                found = true;
                                break;
                            }
                        }

                        if (found)
                        {
                            continue;
                        }

                        esExpression item = new esQueryItem(this, col.Name, col.esType);
                        query.Select(item);
                    }
                }
            }

            foreach (esDynamicQuerySerializable subQuery in iQuery.queries.Values)
            {
                AssignProviderMetadata(subQuery, beenThere);
            }

            if (iQuery.InternalSetOperations != null)
            {
                foreach (esSetOperation setOperation in iQuery.InternalSetOperations)
                {
                    AssignProviderMetadata(setOperation.Query, beenThere);
                }
            }
        }