이 인터페이스는 BOTypeMetadata 패턴을 따르고 이를 SDO(Service Data Object) 세트로 변환하는(예약 변환도 수행함) 어노테이션 BLOB을 사용하는 기능을 제공합니다.
어노테이션은 SDO 구현 특정 API 세트를 사용하여 런타임에 읽을 수 있습니다. 그러나 이러한 API의 문제점은 BLOB를 리턴한다는 점입니다. 따라서 비즈니스 오브젝트 프레임워크는 BOTypeMetadata를 제공하여 BLOB를 읽고 유효성을 검증한 후 사용 가능한 데이터 오브젝트 구조로 변환할 수 있도록 합니다.
다음 예제에서는 BOTypeMetadata 인터페이스 사용 방법을 보여줍니다.
BOFactory factoryService = (BOFactory) new ServiceManager().locateService("com/ibm/websphere/bo/BOFactory"); BOTypeMetadata typeMetadataService = (BOTypeMetadata) new ServiceManager().locateService("com/ibm/websphere/bo/BOTypeMetadata"); DataObject product = factoryService.create("http://www.scm.com/ProductTypes", "Product"); // Use EMF to get the annotation blob, then use the BOTypeMetadata service // to convert it into a data object. String productIDPropertyInfoString = (String) ((EObject)product). eClass().getEStructuralFeature("iD"). getEAnnotation("http://www.ibm.com/xmlns/prod/websphere/bo/6.0.0"). getDetails().get("appinfo"); DataObject productIDPropertyInfo = typeMetadataService.transformAnnotationToDataObject (productIDPropertyInfoString); // Read and update the annotation. // ... // Use the BOTypeMetadata service to transform the data object graph back into // a string, and then use EMF to set the string in the XML schema. String productIDPropertyInfoString2 = typeMetadataService.transformDataObjectToAnnotation (productIDPropertyInfo); ((EObject)product).eClass().getEStructuralFeature("iD"). getEAnnotation("http://www.ibm.com/xmlns/prod/websphere/bo/6.0.0"). getDetails().put("appinfo",productIDPropertyInfoString2);