public void Get(string otherKey) { Names.Get(BusinessKey, EntityType.BusinessEntity); Descriptions.Get(BusinessKey, EntityType.BusinessEntity); // // Get the shared relationships. // SharedRelationshipsFrom.Direction = DirectionType.FromKey; SharedRelationshipsFrom.Get(otherKey, BusinessKey); SharedRelationshipsTo.Direction = DirectionType.ToKey; SharedRelationshipsTo.Get(BusinessKey, otherKey); }
private Catalogue ImportCatalogue(TableInfo ti) { var forwardEngineer = new ForwardEngineerCatalogue(ti, ti.ColumnInfos, true); forwardEngineer.ExecuteForwardEngineering(out Catalogue cata, out _, out ExtractionInformation[] eis); //get descriptions of the columns from BadMedicine var desc = new Descriptions(); cata.Description = Trim(desc.Get(cata.Name)); if (cata.Description != null) { cata.SaveToDatabase(); foreach (var ci in cata.CatalogueItems) { var ciDescription = Trim(desc.Get(cata.Name, ci.Name)); if (ciDescription != null) { ci.Description = ciDescription; ci.SaveToDatabase(); } } } var chi = eis.SingleOrDefault(e => e.GetRuntimeName().Equals("chi", StringComparison.CurrentCultureIgnoreCase)); if (chi != null) { chi.IsExtractionIdentifier = true; chi.SaveToDatabase(); var eds = new ExtractableDataSet(_repos.DataExportRepository, cata); } return(cata); }
/// **************************************************************** /// public Get /// ---------------------------------------------------------------- /// <summary> /// Retrieves the bindingTemplate details from the database. /// </summary> /// ---------------------------------------------------------------- /// <returns> /// </returns> /// ---------------------------------------------------------------- /// <remarks> /// The bindingKey must be set prior to execution of this call. /// </remarks> /// **************************************************************** /// public override void Get() { Debug.Enter(); SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor("net_bindingTemplate_get_batch"); sp.Parameters.Add("@bindingKey", SqlDbType.UniqueIdentifier); sp.Parameters.Add("@serviceKey", SqlDbType.UniqueIdentifier, ParameterDirection.Output); sp.Parameters.Add("@URLTypeID", SqlDbType.TinyInt, ParameterDirection.Output); sp.Parameters.Add("@accessPoint", SqlDbType.NVarChar, UDDI.Constants.Lengths.AccessPoint, ParameterDirection.Output); sp.Parameters.Add("@hostingRedirector", SqlDbType.UniqueIdentifier, ParameterDirection.Output); sp.Parameters.SetGuidFromString("@bindingKey", BindingKey); SqlDataReaderAccessor reader = null; ArrayList instanceIds = new ArrayList(); try { // // net_bindingTemplate_get will return the objects contained in a business in the following order: // // - descriptions // - tmodel instance infos reader = sp.ExecuteReader(); // // Read the descriptions // Descriptions.Read(reader); // // Read the tmodel instance infos // if (true == reader.NextResult()) { instanceIds = TModelInstanceInfos.Read(reader); } } finally { if (null != reader) { reader.Close(); } } // // These calls will make separate sproc calls, so we have to close our reader first. // TModelInstanceInfos.Populate(instanceIds); // // Get output parameters // ServiceKey = sp.Parameters.GetGuidString("@serviceKey"); AccessPoint.URLType = (URLType)sp.Parameters.GetInt("@URLTypeID"); AccessPoint.Value = sp.Parameters.GetString("@accessPoint"); HostingRedirector.BindingKey = sp.Parameters.GetGuidString("@hostingRedirector"); #if never SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor("net_bindingTemplate_get"); sp.Parameters.Add("@bindingKey", SqlDbType.UniqueIdentifier); sp.Parameters.Add("@serviceKey", SqlDbType.UniqueIdentifier, ParameterDirection.Output); sp.Parameters.Add("@URLTypeID", SqlDbType.TinyInt, ParameterDirection.Output); sp.Parameters.Add("@accessPoint", SqlDbType.NVarChar, UDDI.Constants.Lengths.AccessPoint, ParameterDirection.Output); sp.Parameters.Add("@hostingRedirector", SqlDbType.UniqueIdentifier, ParameterDirection.Output); sp.Parameters.SetGuidFromString("@bindingKey", BindingKey); sp.ExecuteNonQuery(); ServiceKey = sp.Parameters.GetGuidString("@serviceKey"); AccessPoint.URLType = (URLType)sp.Parameters.GetInt("@URLTypeID"); AccessPoint.Value = sp.Parameters.GetString("@accessPoint"); HostingRedirector.BindingKey = sp.Parameters.GetGuidString("@hostingRedirector"); // // Get all contained objects. // Descriptions.Get(BindingKey, EntityType.BindingTemplate); TModelInstanceInfos.Get(BindingKey); #endif QueryLog.Write(QueryType.Get, EntityType.BindingTemplate); }
/// **************************************************************** /// public Get /// ---------------------------------------------------------------- /// <summary> /// </summary> /// **************************************************************** /// public override void Get() { Debug.Enter(); SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor("net_businessEntity_get_batch"); sp.Parameters.Add("@businessKey", SqlDbType.UniqueIdentifier); sp.Parameters.Add("@operatorName", SqlDbType.NVarChar, UDDI.Constants.Lengths.OperatorName, ParameterDirection.Output); sp.Parameters.Add("@authorizedName", SqlDbType.NVarChar, UDDI.Constants.Lengths.AuthorizedName, ParameterDirection.Output); sp.Parameters.SetGuidFromString("@businessKey", BusinessKey); SqlDataReaderAccessor reader = null; ArrayList contactIds = new ArrayList(); try { // // net_businessEntity_get will return the objects contained in a business in the following order: // // - descriptions // - names // - discoveryURLs // - contacts // - identifier bags // - category bags // - services // reader = sp.ExecuteReader(); // // Read the descriptions // Descriptions.Read(reader); // // Read the names // if (true == reader.NextResult()) { Names.Read(reader); } // // // Read the discoveryURLs // if (true == reader.NextResult()) { DiscoveryUrls.Read(reader); } // // Read the contacts // if (true == reader.NextResult()) { contactIds = Contacts.Read(reader); } // // Read the identifier bags // if (true == reader.NextResult()) { IdentifierBag.Read(reader); } // // Read the category bags // if (true == reader.NextResult()) { CategoryBag.Read(reader); } // // Read the services // if (true == reader.NextResult()) { BusinessServices.Read(reader); } } finally { if (null != reader) { reader.Close(); } } // // These calls will make separate sproc calls, so we have to close our reader first. // BusinessServices.Populate(); Contacts.Populate(contactIds); // // Get our output parameters. // Operator = sp.Parameters.GetString("@operatorName"); AuthorizedName = sp.Parameters.GetString("@authorizedName"); // // If this entity was published to this node than add the // default discoveryURL. // if (Operator == Config.GetString("Operator")) { // // Only add the default discovery Url to this business // if it was published at this site. // DiscoveryUrls.AddDefaultDiscoveryUrl(BusinessKey); } #if never SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor("net_businessEntity_get"); sp.Parameters.Add("@businessKey", SqlDbType.UniqueIdentifier); sp.Parameters.Add("@operatorName", SqlDbType.NVarChar, UDDI.Constants.Lengths.OperatorName, ParameterDirection.Output); sp.Parameters.Add("@authorizedName", SqlDbType.NVarChar, UDDI.Constants.Lengths.AuthorizedName, ParameterDirection.Output); sp.Parameters.SetGuidFromString("@businessKey", BusinessKey); sp.ExecuteNonQuery(); Operator = sp.Parameters.GetString("@operatorName"); AuthorizedName = sp.Parameters.GetString("@authorizedName"); // // Retrieve contained objects. // Descriptions.Get(BusinessKey, EntityType.BusinessEntity); Names.Get(BusinessKey, EntityType.BusinessEntity); DiscoveryUrls.Get(BusinessKey); // // If this entity was published to this node than add the // default discoveryURL. // if (Operator == Config.GetString("Operator")) { // // Only add the default discovery Url to this business // if it was published at this site. // DiscoveryUrls.AddDefaultDiscoveryUrl(BusinessKey); } Contacts.Get(BusinessKey); BusinessServices.Get(BusinessKey); IdentifierBag.Get(BusinessKey, EntityType.BusinessEntity, KeyedReferenceType.IdentifierBag); CategoryBag.Get(BusinessKey, EntityType.BusinessEntity, KeyedReferenceType.CategoryBag); #endif QueryLog.Write(QueryType.Get, EntityType.BusinessEntity); Debug.Leave(); }
public void Get(int contactId) { SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor("net_businessEntity_contact_get_batch"); sp.Parameters.Add("@contactId", SqlDbType.BigInt); sp.Parameters.SetLong("@contactId", contactId); SqlDataReaderAccessor reader = null; ArrayList addressIDs = new ArrayList(); try { // // net_businessEntity_contact_get_batch will return the objects contained in a business in the following order: // // - descriptions // - phones // - emails // - addresses reader = sp.ExecuteReader(); // // Read the descriptions // Descriptions.Read(reader); // // Read the phones // if (true == reader.NextResult()) { Phones.Read(reader); } // // Read the emails // if (true == reader.NextResult()) { Emails.Read(reader); } // // Read the addresses // if (true == reader.NextResult()) { addressIDs = Addresses.Read(reader); } } finally { if (reader != null) { reader.Close(); } } // // These calls will make separate sproc calls, so we have to close our reader first. // Addresses.Populate(addressIDs); #if never // // Call get method on sub-objects personName and UseType // should have been populate by contacts.get() method; // Descriptions.Get(contactId, EntityType.Contact); Phones.Get(contactId); Emails.Get(contactId); Addresses.Get(contactId); #endif }