BOCopy

이 인터페이스는 비즈니스 오브젝트의 그래프 또는 비즈니스 오브젝트의 그래프를 포함하는 비즈니스 그래프를 복사합니다.

용도

이 인터페이스에는 두 가지 양식이 있습니다. 첫 번째는 비즈니스 오브젝트의 그래프 또는 비즈니스 오브젝트의 그래프를 포함하고 있는 비즈니스 그래프에서 사용됩니다. 유일한 요구사항은 이 양식이 서비스 데이터 오브젝트이면 가능합니다. 다른 양식은 소스 비즈니스 그래프의 서브세트가 대상 비즈니스 그래프로 복사될 때 사용됩니다.

비즈니스 오브젝트 프레임워크는 두 가지 양식의 복사를 정의합니다. 첫 번째는 복잡한 변형 및 간단한 변형의 값에 의한 단순한 복사입니다. 즉, 맨 위 레벨만을 복사하거나 하위도 복사할 수 있음을 의미합니다. 이 복사 메커니즘은 비즈니스 오브젝트의 그래프 또는 비즈니스 오브젝트의 그래프를 포함하고 있는 비즈니스 그래프에 모두 적용할 수 있습니다. 구현은 소스 오브젝트의 형태와 관련이 없습니다.

두 번째 양식은 소스 비즈니스 그래프의 서브세트가 대상 비즈니스 그래프로 복사되는 사용 모델에 적합합니다. 이 양식은 소스 비즈니스 오브젝트(복잡한 변형인 경우 해당 하위 포함) 뿐만 아니라 대상 비즈니스 그래프로 복사되는 비즈니스 오브젝트와 관련된 Change, Event 및 Verb 헤더 정보도 복사합니다.

다음은 copy/Shallow 양식의 예입니다.

BOFactory factoryService =
    (BOFactory) new
		ServiceManager().locateService("com/ibm/websphere/bo/BOFactory");
BOCopy copyService =
    (BOCopy) new ServiceManager().locateService("com/ibm/websphere/bo/BOCopy");

// Use the Factory Create model for the top level object.
DataObject productCategoryBG =
  factoryService.create("http://www.scm.com/ProductCategoryTypes/ProductCategoryBG",
                           "ProductCategoryBG");

// Use the Containment Create model on the contained objects.
DataObject productCategory = productCategoryBG.createDataObject("productCategory");
DataObject product = productCategory.createDataObject("product");

// Copy a business graph (deep).
DataObject newProductCategoryBG = copyService.copy(productCategoryBG);

// Copy a business object (deep).
DataObject newProductCategory = copyService.copy(productCategory);

// Copy a business object (shallow).
DataObject newProductCategory2 = copyService.copyShallow(productCategory);

다음은 copyIntro 양식의 예입니다.

BOFactory factoryService =
    (BOFactory) new
		ServiceManager().locateService("com/ibm/websphere/bo/BOFactory");
BOCopy copyService =
    (BOCopy) new ServiceManager().locateService("com/ibm/websphere/bo/BOCopy");

// Use the Factory Create model for the top level object.
DataObject productCategoryBG =
  factoryService.create("http://www.scm.com/ProductCategoryTypes/ProductCategoryBG",
                          "ProductCategoryBG");

// Use the Containment Create model on the contained objects.
DataObject productCategory = productCategoryBG.createDataObject("productCategory");
DataObject product = productCategory.createDataObject("product");

// Copy a child business object with a business graph context,
// into a new business graph.
DataObject productBG =
  factoryService.create("http://www.scm.com/ProductTypes/ProductBG",
                          "ProductBG");
copyService.copyInto(product, productBG, "product");

다음은 copyIntro Complex 양식의 예입니다.

BOFactory factoryService =
  (BOFactory) new 
		ServiceManager().locateService("com/ibm/websphere/bo/BOFactory");
BOCopy copyService =
  (BOCopy) new ServiceManager().locateService("com/ibm/websphere/bo/BOCopy");

// If you want to perform a complex copy from a source business graph
// to a target business graph and maintain context where:
//
// - The source business graph contains:
//   - ProductCategoryBG productCategoryBG
//   - ProductCategory productCategory0 (parent productCategoryBG)
//   - ProductCategory productCategory1 (parent productCategory0)
//   - ProductCategory productCategory2 (parent productCategory0)
//   - Product product1 (parent productCategory1)
//   - Product product2 (parent productCategory2)
//
// - The target business graph contains:
//   - ProductInventoryBG productInventoryBG
//   - ProductInventory productInventory (parent productInventoryBG)
//     - Property oldProduct (initially empty)
//     - Property newProduct (initially empty)
//
// The following code copies product1 from the source business graph
// to the target business graph's ProductInventory business object's
// oldProduct property, and product2 from the source business graph
// to the target business graph's ProductInventory business object's
// newProduct property.

// Create the source business graph and its graph of business objects.
DataObject productCategoryBG =
  factoryService.create("http://www.scm.com/ProductCategoryTypes/ProductCategoryBG",
                          "ProductCategoryBG");
DataObject productCategory0 = productCategoryBG.createDataObject("productCategory");
DataObject productCategory1 = productCategory0.createDataObject("productCategory");
DataObject productCategory2 = productCategory0.createDataObject("productCategory");
DataObject product1 = productCategory1.createDataObject("product");
DataObject product2 = productCategory2.createDataObject("product");

// Create the target business graph.
DataObject productInventoryBG =

factoryService.create("http://www.scm.com/ProductCategoryTypes/ProductInventoryBG",
                       "ProductInventoryBG");
DataObject productInventory =
    productInventoryBG.createDataObject("productInventory");

// Copy product1 and product2 from the source business
// graph, with their associated ChangeSummary/EventSummary context, into
// the target business graph's ProductInventory business object's oldProduct and
// newProduct properties. Use two mechanisms to demonstrate how path can be used.
copyService.copyInto(product1, productInventory, "oldProduct");
DataObject oldProduct = productInventory.getDataObject("oldProduct");
oldProduct.delete();
copyService.copyInto(product1, productInventoryBG, "productInventory/oldProduct");
관련 참조
BOChangeSummary
BODataObject
BOEquality
BOEventSummary
BOFactory
BOType
BOTypeMetadata
BOXMLDocument
BOXMLSerializer
관련 정보
인터페이스 BOCopy API

이용약관 |

최종 갱신: 2006년 4월 13일

(c) Copyright IBM Corporation 2005, 2006.
이 Information Center는 Eclipse 기술을 기반으로 합니다. (http://www.eclipse.org 웹 사이트 참조)