How to map a collection of object in TopLink?

For (simple) example, I've a XSD that defines:
<xsd:complexType name="AttachmentType">
<xsd:sequence>
<xsd:element name="docID" nillable="false" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="MyDocType">
<xsd:sequence>
<xsd:element name="attachment" nillable="true" minOccurs="0"
maxOccurs="unbounded" type="tns:AttachmentType"/>     
</xsd:sequence>
</xsd:complexType>
This XSD is referenced by a WSDL. Using JDeveloper to generate a Java Web Service using the WSDL and will get the following classes:
public class AttachmentType implements java.io.Serializable
protected java.lang.String docID;
public AttachmentType() {    }
public java.lang.String getDocID() {        return docID;    }
public void setDocID(java.lang.String docID) {        this.docID = docID;    }
public class MyDocType implements java.io.Serializable
protected AttachmentType[] attachment;
public MyDocType () {    }
public AttachmentType[] getAttachment() {        return attachment;    }
public void setAttachment(AttachmentType[] attachment)
this.attachment = attachment;
Now I want to generate a XML document from MyDocType. I use TopLink (JAXB) to do the mapping. However, how to map the 'attachment' of type AttachmentType[]? TopLink seems only allowing List/Set/Collection container options.
Anyone can help?
Note: I have to use the classes generated from WSDL.
Thanks!!

Thanks. I'm using TopLink Workbench for the mapping
and have no idea on how to specify the XML
transformation mapping for array attribute. Can you
tell me more?I was putting together an example of the transformation mapping but came up with a better way. It turns out that a transformation mapping isn't ideal because you have to take over some of the responsibility for converting XML to objects. A better solution is to intercept the calls to the getter and setter for the AttachmentType[] and convert between an Array and List. Just map the Array as a composite collection in the workbench and customize the attachment attribute mapping in code.
Each mapping in TopLink has Accessor object responsible for getting and setting values in objects. If you choose method or direct access the mapping will have a different Accessor class. So the solution is to use an Accessor that converts the List TopLink builds into an Array of the correct type on set. On get, the Accessor creates a List from the Array.
You can introduce a custom Accessor using an After Load method. I've put a complete example up on my googlepages account[1]. The key code is listed below. Note that this code assumes you're using direct instance variable access. Also, this code works with TopLink 10.1.3.2 and the TopLink 11 preview. It won't work with previous versions.
The After Load class that changes the mapping accessor:
public class MyDocCustomizer {
     public static void customize(ClassDescriptor descriptor) {
          XMLCompositeCollectionMapping mapping = (XMLCompositeCollectionMapping)
               descriptor.getMappingForAttributeName("attachment");
          InstanceVariableAttributeAccessor existingAccessor =
               (InstanceVariableAttributeAccessor) mapping.getAttributeAccessor();
          ListArrayTransformationAccessor transformationAccessor =
               new ListArrayTransformationAccessor(AttachmentType.class, "attachment");
          transformationAccessor.initializeAttributes(descriptor.getJavaClass());
          mapping.setAttributeAccessor(transformationAccessor);
}The custom InstanceVariableAccessor subclass:
public class ListArrayTransformationAccessor extends
          InstanceVariableAttributeAccessor {
     private Class arrayClass;
     public ListArrayTransformationAccessor(Class arrayClass, String attributeName) {
          super();
          this.arrayClass = arrayClass;
          this.setAttributeName(attributeName);
     public Object getAttributeValueFromObject(Object anObject)
               throws DescriptorException {
          Object[] attributeValueFromObject =
               (Object[]) super.getAttributeValueFromObject(anObject);
          return Arrays.asList(attributeValueFromObject);
     public void setAttributeValueInObject(Object anObject, Object value)
               throws DescriptorException {
          List collection = (List)value;
          Object[] array = (Object[]) Array.newInstance(arrayClass, collection.size());
          for (int i = 0; i < collection.size(); i++) {
               Object element = collection.get(i);
               Array.set(array, i, element);
          super.setAttributeValueInObject(anObject, array);
}--Shaun
http://ontoplink.blogspot.com
[1] http://shaunmsmith.googlepages.com/Forum-519205-OXM-Array.zip

Similar Messages

  • How to create an collection/array/object/thingy from a bunch of objects for eventual export to CSV.

    This is a follow-up to an earlier post (How
    to output a bunch of variables into a table.) Now that I can ouput data for a single computer I need to to do the same for a list of computers into a CSV. In more general terms how do I get a bunch of $Computer objects into a single collection/array/object/thingy
    with a clever name like $Computers?
    # http://ss64.com/ps/get-wmiobject-win32.html
    # http://social.technet.microsoft.com/Forums/en-US/da54b6ab-6941-4e45-8697-1d3236ba2154/powershell-number-of-cpu-sockets-wmi-query?forum=winserverpowershell
    # http://serverfault.com/questions/10328/determine-cpu-processors-vs-sockets-though-wmi
    # http://social.technet.microsoft.com/Forums/windowsserver/en-US/8443fcfd-5a0b-4c3d-bda7-26df83d2ee92/how-to-output-a-bunch-of-variables-into-a-table?forum=winserverpowershell
    Param(
    [Parameter(Mandatory=$false,ValueFromPipeline=$true)]
    [string]$ComputerName = $env:COMPUTERNAME,
    [Parameter(Mandatory=$false,ValueFromPipeline=$false)]
    [ValidateScript(
    If ( $_ -ne $null ) { Test-Path $_ }
    [String]$ComputerListFile
    Function Get-Computer
    Param(
    [string]$ComputerName
    $Win32_PingStatus = $null
    $Win32_PingStatus_Result = $null
    $Win32_OperatingSystem = $null
    $Win32_Processor = $null
    $Win32_PhysicalMemory = $null
    $Win32_ComputerSystem = $null
    $Win32_BIOS = $null
    $Computer = $null
    $Win32_PingStatus = "select * from Win32_PingStatus where address = '$ComputerName'"
    $Win32_PingStatus_Result = Get-WmiObject -query $Win32_PingStatus
    If ( $Win32_PingStatus_Result.protocoladdress )
    "$ComputerName ping succeeded."
    $Win32_OperatingSystem = Get-WmiObject Win32_OperatingSystem -computer $ComputerName -ErrorAction SilentlyContinue
    If ( $Win32_OperatingSystem -eq $null)
    "$ComputerName WMI failed."
    } Else {
    "$ComputerName WMI succeeded."
    $Win32_Processor = [object[]]$(Get-WmiObject Win32_Processor -computer $ComputerName)
    $Win32_PhysicalMemory = [object[]]$(Get-WmiObject Win32_PhysicalMemory -computer $ComputerName)
    $Win32_ComputerSystem = Get-WmiObject Win32_ComputerSystem -computer $ComputerName
    $Win32_BIOS = Get-WmiObject Win32_BIOS -computer $ComputerName
    $Computer = New-Object -Type PSObject -Property @{
    Name = $Win32_OperatingSystem.CSName
    Win32_BIOS_SerialNumber = [string]$Win32_BIOS.SerialNumber
    Win32_ComputerSystem_Manufacturer = [string]$Win32_ComputerSystem.Manufacturer
    Win32_ComputerSystem_Model = [string]$Win32_ComputerSystem.Model
    #Win32_ComputerSystem_NumberOfLogicalProcessors = [int32]$Win32_ComputerSystem.NumberOfLogicalProcessors
    #Win32_ComputerSystem_NumberOfProcessors = [int32]$Win32_ComputerSystem.NumberOfProcessors
    Win32_ComputerSystem_TotalPhysicalMemory = [long]$Win32_ComputerSystem.TotalPhysicalMemory
    Win32_ComputerSystem_TotalPhysicalMemory_GB = [float]($Win32_ComputerSystem.TotalPhysicalMemory / (1024*1024*1024))
    Win32_OperatingSystem_Caption = [string]$Win32_OperatingSystem.Caption
    Win32_OperatingSystem_CSName = [string]$Win32_OperatingSystem.CSName
    #Win32_OperatingSystem_OSArchitecture = [string]$Win32_OperatingSystem.OSArchitecture
    #Win32_OperatingSystem_SerialNumber = [string]$Win32_OperatingSystem.SerialNumber
    Win32_OperatingSystem_ServicePackVersion = [string]$Win32_OperatingSystem.ServicePackMajorVersion + "." + [string]$Win32_OperatingSystem.ServicePackMinorVersion
    Win32_PhysicalMemory_Capacity = ($Win32_PhysicalMemory | ForEach-Object { $_.Capacity } | Measure-Object -Sum).sum
    Win32_PhysicalMemory_Capacity_GB = (($Win32_PhysicalMemory | ForEach-Object { $_.Capacity } | Measure-Object -Sum).sum / (1024*1024*1024))
    Win32_Processor_Count = [int]$Win32_Processor.Count
    Win32_Processor_NumberOfCores = [string]$Win32_Processor[0].NumberOfCores
    Win32_Processor_NumberOfLogicalProcessors = [string]$Win32_Processor[0].NumberOfLogicalProcessors
    #Win32_Processor_Description = [string]$Win32_Processor[0].Description
    Win32_Processor_Manufacturer = [string]$Win32_Processor[0].Manufacturer
    Win32_Processor_Name = [string]$Win32_Processor[0].Name
    } ## end new-object
    $Computer
    } Else {
    "$ComputerName ping failed."
    $ComputerNameMgmt = $ComputerName + "-mgmt"
    $Win32_PingStatus = "select * from Win32_PingStatus where address = '$ComputerNameMgmt'"
    $Win32_PingStatus_Result = Get-WmiObject -query $Win32_PingStatus
    If ( $Win32_PingStatus_Result.protocoladdress )
    "$ComputerNameMgmt ping succeded."
    } Else {
    "$ComputerNameMgmt ping failed."
    "$(Get-Date -Format o) Starting script $($MyInvocation.MyCommand.Name)"
    If ( $ComputerListFile -eq $null -or $ComputerListFile.Length -eq 0 )
    "Processing computer $ComputerName"
    Get-Computer( $ComputerName )
    } Else {
    "Processing computer list $ComputerList"
    $ComputerList = Get-Content $ComputerListFile
    $Computers = @{}
    $Results = @()
    ForEach( $ComputerListMember in $ComputerList )
    "$(Get-Date -Format o) $ComputerListMember"
    # Get-Computer( $ComputerListMember ) | Add-Member -InputObject $Computers -MemberType NoteProperty -Name $_
    # http://social.technet.microsoft.com/Forums/windowsserver/en-US/e7d602a9-a808-4bbc-b6d6-dc78079aafc9/powershell-to-ping-computers
    # $Compuers += New-Object PSObject -Property $Props
    # $Computers += New-Object PSObject -Property Get-Computer( $ComputerListMember )
    Get-Computer( $ComputerListMember )
    "$(Get-Date -Format o) Ending script $($MyInvocation.MyCommand.Name)"
    If I try something like this:
    Get-Computer( $ComputerListMember ) | Add-Member -InputObject $Computers -MemberType NoteProperty -Name $_
    I get the following, even though $_.Name is not null.
    Add-Member : Cannot bind argument to parameter 'Name' because it is null.
    At <path to my script>Get-Hardware_Memory_OSVersion_CPU_Cores_ver04_sanitized.ps1:111 char:107
    + Get-Computer( $ComputerListMember ) | Add-Member -InputObject $Computers -MemberType NoteProperty -Name <<<< $_
    + CategoryInfo : InvalidData: (:) [Add-Member], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.AddMemberCommand
    Or if I try this:
    $Computers += New-Object PSObject -Property Get-Computer( $ComputerListMember )
    I get this:
    New-Object : Cannot bind parameter 'Property'. Cannot convert the "Get-Computer" value of type "System.String" to type "System.Collections.Hashtable".
    At <path to my script>Get-Hardware_Memory_OSVersion_CPU_Cores_ver04_sanitized.ps1:114 char:47
    + $Computers += New-Object PSObject -Property <<<< Get-Computer( $ComputerListMember )
    + CategoryInfo : InvalidArgument: (:) [New-Object], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.NewObjectCommand

    Hi Aenagy,
    If you want to combine all the computers' information to a single array, and add the property computername in the output, please also try the script below, which I make a little modification of the function Get-Computer, pleaese make sure the account running
    the script has the admin permission of the remote computers, or you need to privide cridentials in get-wmiobject, also note I haven't tested:
    $output = @()#to output information of the all the computers
    ForEach( $ComputerName in $ComputerList ){#loop all the computers
    $Win32_PingStatus = "select * from Win32_PingStatus where address = '$ComputerName'"
    $Win32_PingStatus_Result = Get-WmiObject -query $Win32_PingStatus
    If ( $Win32_PingStatus_Result.protocoladdress )
    "$ComputerName ping succeeded."
    $Win32_OperatingSystem = Get-WmiObject Win32_OperatingSystem -computer $ComputerName -ErrorAction SilentlyContinue
    If ( $Win32_OperatingSystem -eq $null)
    "$ComputerName WMI failed."
    Else {
    "$ComputerName WMI succeeded."
    $Win32_Processor = [object[]]$(Get-WmiObject Win32_Processor -computer $ComputerName)
    $Win32_PhysicalMemory = [object[]]$(Get-WmiObject Win32_PhysicalMemory -computer $ComputerName)
    $Win32_ComputerSystem = Get-WmiObject Win32_ComputerSystem -computer $ComputerName
    $Win32_BIOS = Get-WmiObject Win32_BIOS -computer $ComputerName
    $Computer = New-Object -Type PSObject -Property @{
    Computername = $ComputerName #add the property computername
    Name = $Win32_OperatingSystem.CSName
    Win32_BIOS_SerialNumber = [string]$Win32_BIOS.SerialNumber
    Win32_ComputerSystem_Manufacturer = [string]$Win32_ComputerSystem.Manufacturer
    Win32_ComputerSystem_Model = [string]$Win32_ComputerSystem.Model
    #Win32_ComputerSystem_NumberOfLogicalProcessors = [int32]$Win32_ComputerSystem.NumberOfLogicalProcessors
    #Win32_ComputerSystem_NumberOfProcessors = [int32]$Win32_ComputerSystem.NumberOfProcessors
    Win32_ComputerSystem_TotalPhysicalMemory = [long]$Win32_ComputerSystem.TotalPhysicalMemory
    Win32_ComputerSystem_TotalPhysicalMemory_GB = [float]($Win32_ComputerSystem.TotalPhysicalMemory / (1024*1024*1024))
    Win32_OperatingSystem_Caption = [string]$Win32_OperatingSystem.Caption
    Win32_OperatingSystem_CSName = [string]$Win32_OperatingSystem.CSName
    #Win32_OperatingSystem_OSArchitecture = [string]$Win32_OperatingSystem.OSArchitecture
    #Win32_OperatingSystem_SerialNumber = [string]$Win32_OperatingSystem.SerialNumber
    Win32_OperatingSystem_ServicePackVersion = [string]$Win32_OperatingSystem.ServicePackMajorVersion + "." + [string]$Win32_OperatingSystem.ServicePackMinorVersion
    Win32_PhysicalMemory_Capacity = ($Win32_PhysicalMemory | ForEach-Object { $_.Capacity } | Measure-Object -Sum).sum
    Win32_PhysicalMemory_Capacity_GB = (($Win32_PhysicalMemory | ForEach-Object { $_.Capacity } | Measure-Object -Sum).sum / (1024*1024*1024))
    Win32_Processor_Count = [int]$Win32_Processor.Count
    Win32_Processor_NumberOfCores = [string]$Win32_Processor[0].NumberOfCores
    Win32_Processor_NumberOfLogicalProcessors = [string]$Win32_Processor[0].NumberOfLogicalProcessors
    #Win32_Processor_Description = [string]$Win32_Processor[0].Description
    Win32_Processor_Manufacturer = [string]$Win32_Processor[0].Manufacturer
    Win32_Processor_Name = [string]$Win32_Processor[0].Name
    } ## end new-object
    $output+=$Computer #combine all the "$computer" to "$output"
    Else {
    "$ComputerName ping failed."
    $output
    If you have any feedback on our support, please click here.
    Best Regards,
    Anna
    TechNet Community Support

  • How to process a collection of objects of a derived class?

    I'm trying to clean up some duplicated code.
    I have several classes that have a common parent class. I have in my application several searching and sorting functions that operate on these child classes. But I realized that this is code duplication, as these functions only need data members of the common parent class. So I figured I could make these functions operate on collections of the parent class.
    But during refactoring, I ran into a compiler error that surprised me. This is the SSCCE:
    import java.util.*;
    public class Tinker {
      static class ParentClass {}
      static class ChildClass extends ParentClass {}
      static void processClassCollection( Collection< ParentClass > c ) {}
      public static void main( String[] args ) {
        Collection< ParentClass > parentClassCollection = new Vector< ParentClass >();
        Collection< ChildClass > childClassCollection = new Vector< ChildClass >();
        processClassCollection( parentClassCollection );
        processClassCollection( childClassCollection ); // Why won't this compile?
    }Every object of type ChildClass is also of type ParentClass, right? Every function that requires a ParentClass object, can be passed a ChildClass, right?
    Then, if a function requires a Collection< ParentClass >, why can't I pass it a Collection< ChildClass >?
    Apparently there is a gap of my understanding, either of inheritance, or of Collections. I would very much appreciate clarification, and any suggestion how to deal with such a case.
    -Ron.

    ejp wrote:
    Why can't a Collection< ChildClass > be used where a Collection< ParentClass > is expected?Because Collection< ChildClass > doesn't extend Collection< ParentClass >. They are separate unrelated types.And I think part of the reason this is not allowed. i.e. you can pass ChildClass to a method which expects a ParentClass. is that java doesn't know if you are just looking at the Collection or modifying it. If you could add anything which extends ParentClass to the collection, the collection of ChildClass would not be valid any more.
    The difference is that in the first case, you are passing the reference by value and changing it in the method has no impact on the caller. However, in the case of the Collection, you could corrupt it if you can add objects which the caller does not expect to be in it.

  • SharePoint 2010: How to map documentset attibutes to objects - In SharePoint Webpart

    Hey,
    I guess it's a pretty simple question but I really do not get one inch closer to a solution. I'm working on a WebPart on SharePoint 2010 which manages a documentset (document library with an custom content type). Creating an storing of documentssets works fine
    by now but I do have problems in mapping the stored sets to my c# objects backwards. I actually do not find the fields in my object structure while debugging my code
    I create the docuemtset like this...
    internal DocumentSet CreateDocumentSet(SPList spListObject, SPContentType spContentType, object itemToCreate, Type typeOfItemToCreate)
    var properties = new Hashtable();
    Guid id = Guid.NewGuid();
    //Description
    foreach (PropertyInfo p in typeOfItemToCreate.GetProperties())
    properties.Add(p.Name, p.GetValue(itemToCreate, null));
    SPFolder parentFolder = spListObject.RootFolder;
    DocumentSet docSet = DocumentSet.Create(parentFolder, InnovationListName + "_" + id, spContentType.Id, properties, false);
    return docSet;
    I'm thinking of somethink like this ...
    internal MyObject DocSetToObject(SPList list, int ID)
    var docset = DocumentSet.GetDocumentSet(list.GetItemById(ID).Folder);
    return new MyObject
    Text= docset...,
    Id = docset...,
    Tags= docset...,
    Title = docset...,
    Hope you can help me out.. This problem is killn me  ^^ ;-)
    Thanks
    Spanky

    Hi,
    According to your description, you might want to create a class to perform the CRUD operations against a DocumentSet in your library.
    Here is a demo about how to handle an item for your reference:
    //Create a MyItemWrapper.cs:
    public class MyItemWrapper
    public int ID { get; set; }
    public string Title { get; set; }
    SPList list;
    SPListItem item;
    public MyItemWrapper()
    using (SPSite site = new SPSite("http://sp"))
    using (SPWeb web = site.RootWeb)
    list = web.Lists["List2"];
    item = list.Items[0];
    this.ID = item.ID;
    this.Title = item["Title"].ToString();
    public void setTitle(string t)
    item["Title"] = t;
    item.Update();
    this.Title = t;
    Feel free to reply if this is not what you want.
    Best regards
    Patrick Liang
    TechNet Community Support

  • How to compare a collection of objects?

    Basically I am checking answers to security questions.
    So I have an id, a question no and the answer_text stored in a table.
    What I intend to do is retrieve this into a collection and compare that to the collection passed in.
    If they match , I return true else I return false.
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE 11.2.0.1.0 Production
    TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    referencing this thread on collections
    Re: Compare Collections   - PL-00306
    I based my example on TUBBY's example.
    create or replace
    type answer_array_obj
    as
    object(id number,
              question_no number,
              answer_text varchar2(100)
    create or replace type answer_array as table of answer_array_obj;
    DECLARE
    first_list  answer_array_type := answer_array_type(answer_array_obj(1,1,'ONE'),
                                                                             answer_array_obj(1,2,'TWO'),
                                                                             answer_array_obj(1,3,'THREE')
    second_list  answer_array_type := answer_array_type(answer_array_obj(1,1,'ONE'),
                                                                             answer_array_obj(1,2,'TWO'),
                                                                             answer_array_obj(1,3,'THREE')
    compare_list answer_array_type := answer_array_type(NULL);
    BEGIN
    compare_list := first_list  MULTISET EXCEPT second_list;
    IF compare_list.COUNT = 0
    THEN
        compare_list := second_list MULTISET EXCEPT first_list;
    END IF;
    IF compare_list.COUNT = 0
    THEN
        DBMS_OUTPUT.PUT_LINE('EQUAL');
    ELSE
       DBMS_OUTPUT.PUT_LINE('THE ABSENCE OF EQUALITY');
    END IF;
    END;
    /When I looked at the example , by user 933207, he appeared to be using two different objects.
    18 BEGIN
    19 load1( nt_copy1);
    20 load2( nt_copy2);

    Hi,
    what is the question? I doesnt work? So you have to provide a map method
    CREATE OR REPLACE TYPE  "ANSWER_ARRAY_OBJ"
    as
    object(id number,
              question_no number,
              answer_text varchar2(100),
              MAP MEMBER FUNCTION match RETURN VARCHAR2);
    CREATE OR REPLACE TYPE BODY  "ANSWER_ARRAY_OBJ"
    as
              MAP MEMBER FUNCTION match RETURN VARCHAR2 is
              begin
                return to_char(id)||to_char(question_no)||answer_text;
              end;
    end;
    create or replace type answer_array_type as table of answer_array_obj;
    DECLARE
    first_list  answer_array_type := answer_array_type(answer_array_obj(1,1,'ONE'),
                                                                             answer_array_obj(1,2,'TWO'),
                                                                             answer_array_obj(1,3,'THREE')
    second_list  answer_array_type := answer_array_type(answer_array_obj(1,1,'ONE'),
                                                                             answer_array_obj(1,2,'TWO'),
                                                                             answer_array_obj(1,3,'FOUR')
    compare_list answer_array_type := answer_array_type(NULL);
    BEGIN
    compare_list := first_list  MULTISET EXCEPT second_list;
    IF compare_list.COUNT = 0
    THEN
        compare_list := second_list MULTISET EXCEPT first_list;
    END IF;
    IF compare_list.COUNT = 0
    THEN
        DBMS_OUTPUT.PUT_LINE('EQUAL');
    ELSE
       DBMS_OUTPUT.PUT_LINE('THE ABSENCE OF EQUALITY');
    END IF;
    END;
    THE ABSENCE OF EQUALITY
    Statement processed.
    0.02 secondsregards

  • How to map XML to database object ?

    Hello,
    We are trying to convert XML file into XMLType object and then to our custom object type using registered XSD definition. So we doing this : clob with xml -> XMLObject -> our MMS_T object.
    The problem we experienced with transfering values of "type" and "status" attributes to object values MMS_T.TYPE and MMS_T.STATUS. Note that types MMS_T and ERROR_T are automatically created during schema
    (XSD) registration. See and try Listing 1.
    The second Listing contains anonymous pl/sql block with our testcase, please run it after registering schema. The output You will get should look like this one :
    Schema based
    Well-formed
    <?xml version="1.0" encoding="UTF-8"?>
    <mms-provisioning xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xdb="http://xmlns.oracle.com/xdb" type="subscription"
    status="error">
    <error code="1">Some error</error>
    <serviceID>iDnes</ser
    Type:,Status:,Error:1-Some error,ServiceID:iDnes,Method:SMS,MSISDN:+420602609903
    The problem is visible on the last line, where "Type" and "Status" object attributes should have its values that should come from XML, but they haven't. Where we were wrong ?
    Please help,
    Thanks & Regards,
    Radim.
    Note
    ====
    When we are trying to do xml.schemaValidate() in our example, it raises folowong errors :
    ORA-31154: invalid XML document
    ORA-19202: Error occurred in XML processing
    LSX-00310: local element or attribute should be namespace qualified
    ORA-06512: at "SYS.XMLTYPE", line 0
    ORA-06512: at line 27
    Listing 1
    =========
    declare
    xsd clob:=
    '<?xml version="1.0" encoding="UTF-8"?>
    <xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" elementFormDefault="qualified"
    attributeFormDefault="unqualified"
    xdb:mapStringToNCHAR="false"
    xdb:mapUnboundedStringToLob="false"
    xdb:storeVarrayAsTable="false"
    >
    <xs:element name="mms-provisioning" xdb:SQLType="MMS_T">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="error" minOccurs="0" xdb:SQLName="ERROR" xdb:SQLType="ERROR_T">
    <xs:complexType>
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="code" type="xs:decimal" use="required" xdb:SQLName="CODE" xdb:SQLType="NUMBER"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    </xs:element>
    <xs:element name="serviceID" type="xs:string" xdb:SQLName="SERVICEID" xdb:SQLType="VARCHAR2"/>
    <xs:element name="method" type="xs:string" xdb:SQLName="METHOD" xdb:SQLType="VARCHAR2"/>
    <xs:element name="msisdn" type="xs:string" xdb:SQLName="MSISDN" xdb:SQLType="VARCHAR2"/>
    </xs:sequence>
    <xs:attribute name="type" type="type_t" use="required" xdb:SQLName="TYP" xdb:SQLType="VARCHAR2"/>
    <xs:attribute name="status" type="status_t" use="required" xdb:SQLName="STATUS" xdb:SQLType="VARCHAR2"/>
    </xs:complexType>
    </xs:element>
    <xs:simpleType name="status_t">
    <xs:restriction base="xs:string">
    <xs:maxLength value="30"/>
    <xs:enumeration value="new"/>
    <xs:enumeration value="pending"/>
    <xs:enumeration value="subscribed"/>
    <xs:enumeration value="error"/>
    </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="type_t">
    <xs:restriction base="xs:string">
    <xs:maxLength value="30"/>
    <xs:enumeration value="subscription"/>
    <xs:enumeration value="unsubscription"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:schema>';
    begin
    dbms_XMLSchema.RegisterSchema (
    SchemaURL => 'http://www.eurotel.cz/xsd/mms-provisioning.xsd', SchemaDoc => xsd
    end;
    Listing 2
    =========
    declare
    o mms_t;
    doc clob :=
    '<?xml version="1.0" encoding="UTF-8"?>
    <mms-provisioning type="subscription" status="error">
    <error code="1">Some error</error>
    <serviceID>iDnes</serviceID>
    <method>SMS</method>
    <msisdn>+420602608696</msisdn>
    </mms-provisioning>';
    xml XMLType;
    begin
    xml := XMLType.createXML(XMLData => doc,schema => 'http://www.eurotel.cz/xsd/mms-provisioning.xsd'); --
    if xml.isSchemaBased() = 1 then
    dbms_output.put_line('Schema based');
    else
    dbms_output.put_line('Non-Schema based');
    end if;
    if xml.isFragment() = 1 then
    dbms_output.put_line('Fragment');
    else
    dbms_output.put_line('Well-formed');
    end if;
    --Crashes with errors
    --xml.schemaValidate();
    dbms_output.put_line(substr(xml.getstringval(),1,255));
    xml.toObject(o,schema => 'http://www.eurotel.cz/xsd/mms-provisioning.xsd', element => 'mms-provisioning');
    dbms_output.put_line(
    'Type:'||o.typ||
    ',Status:'||o.status||
    ',Error:'||o.error.code||'-'||o.error.sys_xdbbody$||
    ',ServiceID:'||o.serviceid||
    ',Method:'||o.method||
    ',MSISDN:'||o.msisdn);
    end;
    /

    thanks for the reply
    my source XML response will be looking something like this (it will be reponsed in a long string):
    <?xml version='1.0' encoding='UTF-8'?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
    <SOAP-ENV:Header>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
    <status>
    <retCode>00</retCode>
    <retCodeDesc>OK</retCodeDesc>
    <rRobjectId>09002347802d2981</rRobjectId>
    <rFileSize>7</rFileSize>
    <rTotalPages>1</rTotalPages>
    </status>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    my RFC is:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:sap-com:document:sap:rfc:functions" targetNamespace="urn:sap-com:document:sap:rfc:functions">
    <xsd:element name="ZRFC_SET_DOCUMENT.Response">
    <xsd:complexType>
    <xsd:all>
    <xsd:element name="RETCODE" type="xsd:string" minOccurs="0" />
    <xsd:element name="RETCODEDESC" type="xsd:string" minOccurs="0" />
    <xsd:element name="RFILESIZE" type="xsd:string" minOccurs="0" />
    <xsd:element name="RROJECTID" type="xsd:string" minOccurs="0" />
    <xsd:element name="RTOTALPAGES" type="xsd:string" minOccurs="0" />
    </xsd:all>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>

  • How to Map the parameters in GP interface?

    Hello All ,
    I have 2 callable objects in two different actions for same Block. How to map the first callable object output to input of second callable object ??
    Please give the clear details.
    Thanks
    Risha

    Hello,
    Goto the Block -> Parameters tab....select the 2 parameters ...click on Group button .....give a name to it and click 'Create Group' button.....
    Regards,
    Shikhil

  • How to install business content Info Objects..

    Hello all.
    I am trying to do some BW extraction in our sandbox. Unfortunately I dont know how to install BC infoobjects. I have searched thru this forum but am still not fully sure. I have the source system client connected to BI. I replicated the datasources and see a ton of datasources under the UNASSIGNED NODES tree.
    Eg: How do I install the InfoObject 0Material. Can somone tell me steps..I think I can figure out the rest after that.
    Thanks in advance.

    Hi
    The Data Warehousing Workbench for installing BI Content has three navigation windows:
    In the left-hand window you determine the view of the objects in the middle area of the screen.
    In the middle window, you select the objects that you want to activate.
    In the right-hand window, you make the settings for installing the BI Content. The right-hand window also contains an overview of the objects you have selected, and it is here that you start installation of BI Content.
    In the Data Warehousing Workbench, you use the Navigation Window On/Off pushbutton in the toolbar to display or hide the left-hand navigation window. The rest of this section assumes that the left-hand navigation window is displayed.
    2. Assign Relevant Source Systems
    If you want to assign a source system, select the Source System Assignment function. The Choose Source System by Default? dialog box appears.
    Select one or more source systems by setting the corresponding indicators in the Default Assignment column.
    Only ever select the source systems that you really need, otherwise you may have to wait unnecessarily when objects are collected.
    The assignment of the source system is only relevant for source-system dependent objects (such as transfer rules, file DataSources, and InfoPackages). If more than one source system is available, only those objects assigned to the specified source system are collected ready for the transfer. Objects that have not been assigned to the specified source systems are ignored.
    For more information about the special features inherent in activating process chains that can reference source-system dependent objects, see the Customer Content documentation, under Process Chains and Process Variants.
    If you do not select a source system, all the source systems are assigned automatically. You can change your selection later using the Source System Assignment function.
    3. Group Objects To Be Included, Determine Mode of Collection for Objects
    Make the settings you require from the following selection lists on the right-hand side of the screen:
    Grouping
    Choose the objects that you want the system to include. The groupings combine the objects from a particular area. You have the following options:
    Only Necessary Objects (default setting)
    Data Flow Before
    Data Flow Afterwards
    Data Flow Before and Afterwards
    If you change the default setting (Only Necessary Objects), the new setting becomes the default setting for your user.
    The grouping selection has an impact on system performance during BI Content installation. For more information, see View of Objects and Object-Specific Recommendations.
    Collection Mode
    Select how you want to collect the objects:
    Collect Automatically (default setting): The data is collected when the objects are selected.
    Start Manual Collection: The data is only collected when you choose Collect Dependent Objects.
    Set the collection mode to Start Manual Collection. You can select all the objects without having to wait.
    4. Determine View of Objects
    In the left-hand navigation window, specify how you want the objects to be displayed. For more information, see View of Objects and Object-Specific Recommendations.
    5. Transfer the Objects to Collected Objects
    In the central area of the screen, select the objects that you want to install, and drag and drop them into the right-hand Collected Objects area of the screen.
    The Find Object function allows you to use strings of characters (for example, 0CUST) or wild card searches (for example, 0CUST_*B) to search for objects.
    Input help is available for every type of object: Double-click on the Select Objects icon in the tree structure of the corresponding object type to display the Input Help for Metadata screen. Select the required objects. Choose Transfer Selection.
    If you implement BI Service API Releases lower than 7.0 in the source system, you have to install the active version of the BI Content DataSources in the source system and replicate them in the BI system before you can use them for transferring data into BI. For more information, see Installing BI Content DataSources and Metadata Upload for SAP Systems.
    In the Collected Objects area of the screen, the system displays the selected objects and all dependent objects. Collected objects are stored by default in the repository cache. This reduces the time it takes to access these objects when you want to use them again.
    When you transfer objects into the Collected Objectsarea of the screen, these objects are also added to the tree structure of the corresponding object type in the central area of the screen and stored for your user. This personal object list can be called up each time the program is restarted.
    If you want to remove objects from your personal list, select the objects that you want to remove and choose the Remove Object from Display option from the context menu or click on the icon.
    Objects that are listed in several tree structures can only be changed in the place where they first appear. All additional instances of these objects are grayed out so you cannot modify them.
    6. Check Settings for Collected Objects
    Check the following columns in the Collected Objects area of the screen:
    Install
    The following BI Content objects are highlighted in this column by default:
    Objects that are being transferred for the first time. There is not an active version of these objects in the system.
    BI Content objects that have been redelivered in a new version. These objects can be identified by the Content time stamp in the corresponding object tables.
    When setting this indicator, check whether the checkbox refers to a folder of an individual object: If the checkbox refers to a folder, the indicator is set for all the objects that belong to this folder. If the checkbox refers to an individual object, the indicator is set for a single object and the indicators for the other objects in the folder are not changed. The same applies if you deselect this indicator.
    In the context menu, the following options are available for the installation:
    a. Install All Below
    The object in the selected hierarchy level and all objects in the lower levels of the hierarchy are selected as to Install.
    b. Do Not Install All Below
    The Install indicators are deselected for the object in the selected hierarchy level and all objects in the lower levels of the hierarchy.
    Match (X) or Copy
    If the SAP delivery version and the active version can be matched, a checkbox is displayed in this column.
    With the most important object types, the active version and the SAP delivery version can be matched.
    Note that the InfoSource TRCS supports the match, but the 3.x InfoSource ISTD does not.
    From a technical point of view, the SAP delivery version (D version) is matched against the M version. As in most cases the M version is identical to the active version (A version) in a customer system, this is referred to as a match between the D and A versions for reasons of simplification.
    When a match is performed, particular properties of the object are compared in the A version and the D version. First it has to be decided whether these properties can be matched automatically or whether this has to be done manually. If you are sure that the object will be used in the same way after you install BI Content, you can perform an automatic match for those properties. When performing matches manually you have to decide whether the characteristics of a property from the active version are to be retained, or whether the characteristics are to be copied from the delivery version.
    Assign points if useful.
    Thanks & Regards,
    Hari

  • JPA:How to map List Map Enumerated,EntityType database?

    as we know that we can map collections to database with ElementCollection annotation; how to map a collection of collection of entity?
    for example:
    List<Map<Enumerated,EntityType>>
    thanks

    you have to do customization to acheive this.
    Check this Link
    Re: OIM: Manager Request access for subordinate

  • How to map an object to its ID in a table?

    Here is my situation:
    class Foo {
      private Bar bar;
    }How to map the Bar object into a DB table column of its ID on the ORM mapping file?
    Thanks very much in advance.

    Never mind. I have solved this issue myself.
    Message was edited by:
    vwuvancouver

  • How do you retrieve a Collection of objects using JDBC?

    How do you retrieve a Collection of objects using JDBC.
    MORE INFO:
    I have created a class i.e. Account class and I want to retrieve all the accounts previously created for accounts in my Mysql database..
    my method would retrieve an array of Account instances in the database i.e.
    public Vector retrieveAccounts();

    Connection con = null;
    ArrayList accounts = new ArrayList();
    try{
      con = DriverManager.getConnection(...);
      PreparedStatement ps = con.prepareStatement("select * from accounts");
      Resultset rs = ps.executeQuery();
      while (rs.next()) {
        Account account = new Account(rs.getString(1), rs.getString(2), ...);
        accounts.add(account);
      Account[] account_array = new Account[accounts.size()];
      accounts.toArray(account_array);
    catch (SQLException sqle) {
       sqle.printStackTrace();
    finally {
      if (con != null) {
        con.close();
    }should pretty much to what you want, you will obviously need to change it so that, a) the SQL query is correct and b) the Account class is correct and c) the correct values are taken from the result set to create an account.

  • How to Map the Unit field  in case of DSO and INFOCUBE

    Dear Experts,
    I have a issue ,Please help me to solve this
    I have DSO as provider ,
    And, i have to map transformations  btw the Datasource and DSO.
    In generic Data source,  i have unit fields like BASME,MEINS (Quantity units) & STWAE (currency field)
    and normal Quantity fields  like KWMNG,OAUME(quantity related),OAUWE (value related).
    In DSO data fields as Key figure info objects like  0Quantity (which have 0Unit as unit of measure) and some other  key figures which have there respective unit of measure in info object  definition.
    So you Please tell me how to map the Quantity ,Amounts, unit fields to key figures that we have.
    (How it will be for both DSO and Info cube is there any difference?)
    Edited by: AnjunathNaidu on Jan 18, 2012 1:20 PM

    Navasamol ,
    If it is works ,will u please tell me what is the difference ,if the transformations btw data source and DSO and
    what is the difference btw data source and info cube and btw DSO to Infocube or cube to cube .
    And i have  seen the Quantity fields  and there respective unit fields are mapped directly  to key figure info object
    in case of Info cube . Its working fine .
    If only 1:1 mapping allowed in DSO data fields key figures and there respective unit of measure characteristic.
    why this difference btw DSO and Info cube can any one explain me in detail.
    Expecting your valuable suggestions.
    Thanks & Regards,
    Anjunath Naidu
    Edited by: AnjunathNaidu on Jan 18, 2012 4:05 PM

  • How do I disable linked smart-object auto-update/refresh?

    Working in the CC3D features, I am constantly making changes to my bump map. Every time I step-backwards, or make a significant change to the bump texture (smart object?), CC auto-saves the layer. This specific file is a very very large document (3 gigs in the bump texture layer alone), and the 3D layer has lots of lights and is very complex. This auto-refresh/update really bogs down the time that it would take me to make my changes. I have a very fast machine (I know it's fast, I dont need to list my specs), and I have all shadows disabled.
    How do I disable linked smart-object auto-update/refresh?

    If you do not like a feature like smart objects there is nothing forcing you to use it. Use some other features to do what you want. Please don't ask Adobe to introduce bug into smart object support.
    You could work on your bump maps textures in external files. When your done some time in the future you could edit your project with the smart object layer and use replace smart object. Only then will all smart filters be applied to the smart layer with the replaced smart object.
    Or if by CC Auto save Layer you referring to CC Generate feature you can disable that feature.
    I have no idea what your referring to when you write "CC auto-saves the layer" being a feature. I know CC Generate will write layers out as web files but that more a Web feature then a 3d feature.  Where do you see your layer being saved?

  • How can i reference a MIME object within a correspondence format through...

    how can i reference a MIME object within a correspondence format through TX oofo or se71?
    Hi, I need to put a MIME object within a correspondence's format that i've already done through Tx oofo. My problem is, that i don't know exactly how can i make the reference of that MIME object in the format? and What structure type do i have to use in order to make appear the MIME object in my correspondence's format? Does anybody can help me with this?   
    Regards    Hector

    Frank,
    I tried to find some examples/samples on how to create CollectionModel for a table component but not successful.
    Can you clarify the following ?
    1. "CollectionModel" is referenced only by af:table attributes "value", "selectedRowKeys" and "selectionListener".
    The rest of af:table attributes such as "rows", "fetchSize" used to reference the iterator binding in the binding container via the EL expression "#{bindings.VOIteratorBinding.xxx} .
    What should I replace that EL expression with?
    2. I heck out the bean method to create the CollectionModel as following, is it close to what you mean?
    public void initBusinessDataDashboardView() {
    OperationBinding operation = BeanUtils.getOperationBinding("getPanelBusinessData");
    Map params = operation.getParamsMap();
    Key panelKey = getPanelInfoView().getKey();
    params.put("panelKey", panelKey);
    params.put("maximizedView", false);
    panelView = (ViewObject)operation.execute();
    // Heck code to create CollectionModel
    RowSet rowSet = panelView.getRowSet();
    ArrayList rowList = new ArrayList();
    while (rowSet.hasNext()) {
    rowList.add(rowSet.next());
    model = new ChildPropertyTreeModel(rowList, null);
    // To be used to set up af:table value, selectRowKeys, selectionListener via EL expr #{backingBeanScope.MyBean.model.xxx}
    public CollectionModel getModel() {
    return model;
    Am I on the right track?
    Edited by: Pricilla on May 4, 2010 2:20 PM

  • Looking for a better design: how to populate db result to object with lists

    I have a query that returns from the db an arrayList of class CarBean:
    carID, model, color, rentUserID, fname, lname, dateRentStart, dateRentEndThe query is with reference to a particular car that N people (rentUserID) rented and the user (the system user) wish to know how many rentals were made for this carID.
    I wish to populate the result into ONE class name CarRental which looks like this:
    private Car; //model
    private List<RentUser> rentals; //all info relating to rentUserso, my question is this, what creative way (Design Pattern, maybe?) is there to populate all the objects (CarBean) from the arrayList into CarRental?
    In my solution I'm doing something like this:
    Iterator<CarBean> itr = list.iterator();
    CarRental carRental = new CarRental();
    List rentals = new ArrayList();
    while (itr.hasNext())
        CarBean cb = itr.next();
        carRental.setCarID(cb.getCarID);
        //for the list of users:
       User u = new User(); 
       u.setUserID(cb.getUserID()); 
       rentals.add(u);
    carRental.setRentals(rentals);* please consider a more complicated query that the end result of ONE object should have X arrayList and other M objects in it
    thank you!

    Just to make sure I understand, here's a simple version of your question. Please correct anything I have wrong.
    Your design will have two classes: Car and Renter. A Renter is a Person who rents a Car on a given day:
    package model;
    public class Renter implements Serializable
        private Long id;
        private String name;
        private Address address;
        // Details left for you.
    }You'll also have a Car:
    package model;
    public class Car implements Serializable
        private Long id;
        private String make;
        private String model;
        private int year;
        // Details left for you.
    }It sounds like you want to have a one-to-many relationship between Car and Renter. I think you have a couple of choices:
    You can embed a List<Renter> as a data member inside the Car class, or
    You can encapsulate the relationship between a Car and a Renter in a separate class like a Contract.
    I kinda like the second option because it reifies a nice concept.
    As far as the database goes, I'd recommend following an idiom from Spring- their RowMapper interface:
    package persistence;
    public interface RowMapper
        Object map(ResultSet rs);
    }Encapsulate the mapping from ResultSets to Objects that way.
    Or use Hibernate, TopLink, or another ORM tool.
    %

Maybe you are looking for

  • Pre-installed win 8.1 and new hard disk

    Goodevening, I have a G50-30 with win8.1 pre-installed. I didnt recived any disk, no driver disk, no software disk, no windows disk, even no windows product key. Anyway, I'd like to change my hdd to ssd. So i've started with trying to create a window

  • WHICH IS BETTER OPTION IN THE U.S. MARKET SAP CRM or SAP SD

    HI I WISH TO DO A COURSE IN SAP I HAVE TO DECIDE BETWEEN 2 OPTIONS SHOULD I DO SAP SD or SAP CRM WHICH ONE IS A BETTER OPTION AS I AM AN M.B.A. IN MARKETING WITH NO I.T. OR TECH KNOWLEDGE AT ALL. SO WHAT CAN YOU RECCOMEND PLEASE REPLY IT WOULD BE APP

  • DNP3: Problem with Send Poll Device Attribute Vi - Group 0

    We are using the Labview DNP3 library to test our DNP3 slave. When the DNP3 master (Labview) sends group 0 variation 248, to get the serial number (using the Send Poll Device attribute Vi), LabView is using qualifier code 6, instead of 0, which is in

  • HELP! I lost all my images!??

    I was looking at my Image Gallery and then everything started to corrupt one by one and now all of my images are gone! Is there any way to retrieve and see where these images went? Where can I find event the corrupt images? Look forward to help. C

  • SmartView Error - "The data entered is wrong"

    There is an alert in Smart View Ad Hoc that appears intermittently that says "The data entered is wrong, so it will revert back to the previous value". What causes this and what is the resolution? I realize this question was already asked but I didn'