XSU: Nested Collections?

Does anyone know of a way to get around Oracle's limitation on nested collections?
I have been using XSU to present XML to our Java application layer using objects and object views. Casting multisets works fine for repeating elements as long as the elements themselves don't contain repeating elements. I have been able to get around this with nested cursors, but I am not sure that XSU was designed to work this way. I get a nasty error if any of the cursors return an empty set.
Example:
SELECT
company_name,
CURSOR(SELECT
dept_name,
CURSOR(SELECT
group_name
FROM group_table g
WHERE g.dept_id = d.dept_id) AS "GROUPS"
FROM
dept_table d
WHERE
d.company_id = c.company_id) AS "DEPARTMENTS"
FROM company_table c
If any of the above cursors returns an empty set then I get the following error:
oracle.xml.sql.OracleXMLSQLException: Closed Statement: oracle.jdbc.oci8.OCIDBStatement@18f375
Anyone gotten around this another way?

Hi Christopher,
I posted a similar question before. I even don't know how to create such a table to store XML data.
Like your example
<company>
<dept>
<group>
<emp>
</emp>
</group>
<group>
</group>
</dept>
<dept>
</dept>
</company>
Do you know how to create a table to store this kind of xml data with several hierarchical levels?
null

Similar Messages

  • Nested Collections In Bridge?

    Is it possible to create nested collections in Bridge? I've looked in the help file, but can't find any mention. Don't know if I'm missing it or it just can't be done.
    Thanks,
    Chuck

    Collection is not folder it is just the file that is created in the bridge preferences to ease out the navigation for the user.
    Go to C:\Users\<user name>\AppData\Roaming\Adobe\Bridge CS5\Collections
    you will find the filelist files ther with the name of your collection, if you open those file in the wordpard you will see the path of the files included in the collection.
    hence I dont think the nested collection could be created becuase we cannot refer the filelist file in another filelist file.

  • Locking objects in nested collections

    Hi,
    I am looking at having a data store in memory which will be made up of nested collections e.g. a hashmap whose values are hashmaps. This data store will be accessed by multiple threads and to avoid threading issues on updates I realize I have to implement some form of locking. However I don't want to coarse grain lock the data store for all accesses when updating and I would prefer to lock on a more finer grained level.
    My question is this, is it possible to place a lock on an object in a collection or those the entire collection have to be locked e.g. given a hashmap within a hashmap is it possible to lock the inner hashmap and not the outer.
    regards
    Noel

    I don't think there could be any issue. Get the object from the hash map and lock it. But the Object should have synchronized methods to handle multiple threads, So that when multiple threads get reference to the same object from the hash map they get a synchronized access to the data or logic in the Object.

  • Printing nested collections

    I have a struts application and trying to display a nested collection. For example, I have an arraylist of Persons object which in turn has a collection of Accounts object. Whats the syntax for iterating through the nested collection using the tags like
    <logic:iterate id="item" name="myList" scope="request" >
    <bean:write name="item" property="firstName"/>
    * How do I iterate through the nested collection of Accounts here
    </logic:terate>
    I want to avoid writing scriplets for the same.
    Thanks

    Collection is not folder it is just the file that is created in the bridge preferences to ease out the navigation for the user.
    Go to C:\Users\<user name>\AppData\Roaming\Adobe\Bridge CS5\Collections
    you will find the filelist files ther with the name of your collection, if you open those file in the wordpard you will see the path of the files included in the collection.
    hence I dont think the nested collection could be created becuase we cannot refer the filelist file in another filelist file.

  • How to migrate nested collections?

    In our SCCM 2007 environment we have dozens of nested collections, some are 4 or 5 collections deep too.   How do you migrate that over to CM2012?   In a lab environment I tried to migrate the collection.
    TestCollection\One Deep\Two Deep\Three Deep
    Each of the 4 collection had a machine inside of it. the migration wizard worked but I don't see my collections in the CM2012 console.
    mqh7

    The Collections should be migrated, ususally it's a refresh of the console that is required to see the new folders and Collections. One thing you can do to verify the migration is checking the "objects in job" status. It will provide you with information
    about the success/failure of the migration. You can also check the migmctl.log file for detailed information about the process.
    Kent Agerlund | My blogs: blog.coretech.dk/kea and
    SCUG.dk/ | Twitter:
    @Agerlund | Linkedin: Kent Agerlund |
    Mastering ConfigMgr 2012 The Fundamentals

  • UIX DataControl : Nested Collection Help Please

    Hello all,
    I am developing an app using the ff. evironment:
    IDE: JDeveloper 9052
    UI: ADF UIX
    Core: EJB
    1. I have a Session Bean that returns a collection of a POJO containing 2 POJOs and a collection of another POJO.
    2. I created a DataControl for the Session bean, set the bean class (in the XML datacontrol) as well as the Collection type for the other property. ?I am wondering how to set the bean property for the collection elements?.
    3. I then dragged the return for each of the POJOs and collection contained in the collection onto my UIX page as a read-only table. The return values for POJOs in the collection were rendered but the return values for the nested collection is not, I can only see a table with empty rows and columns .
    This is the collection class:
    public class NestedCollection {
    public nestedCollection(){
    private Pojo1 pojo1;
    private Pojo2 pojo2;
    private Collection nestedOne;
    //...accessor methods
    What is the workaround for this?

    Found it. I did not recompile. gee

  • [svn:bz-4.0.0_fixes] 20615: fixing the regression failure caused by the nest collection level fix, an actionscript type without remote alias will resolved as " className", we should filter out the special case

    Revision: 20615
    Revision: 20615
    Author:   [email protected]
    Date:     2011-03-04 12:11:09 -0800 (Fri, 04 Mar 2011)
    Log Message:
    fixing the regression failure caused by the nest collection level fix, an actionscript type without remote alias will resolved as ">className", we should filter out the special case
    Modified Paths:
        blazeds/branches/4.0.0_fixes/modules/core/src/flex/messaging/io/amf/AmfIO.java

    Remember that Arch Arm is a different distribution, but we try to bend the rules and provide limited support for them.  This may or may not be unique to Arch Arm, so you might try asking on their forums as well.

  • [svn:bz-4.0.0_fixes] 20586: backporting nest object level fix and nest collection level fix from blazeds trunk to 4 .0.0.fixes branch

    Revision: 20586
    Revision: 20586
    Author:   [email protected]
    Date:     2011-03-03 13:44:51 -0800 (Thu, 03 Mar 2011)
    Log Message:
    backporting nest object level fix and nest collection level fix from blazeds trunk to 4.0.0.fixes branch
    checkintests pass
    Modified Paths:
        blazeds/branches/4.0.0_fixes/modules/common/src/flex/messaging/errors.properties
        blazeds/branches/4.0.0_fixes/modules/core/src/flex/messaging/endpoints/AbstractEndpoint.j ava
        blazeds/branches/4.0.0_fixes/modules/core/src/flex/messaging/io/SerializationContext.java
        blazeds/branches/4.0.0_fixes/modules/core/src/flex/messaging/io/amf/Amf0Input.java
        blazeds/branches/4.0.0_fixes/modules/core/src/flex/messaging/io/amf/Amf0Output.java
        blazeds/branches/4.0.0_fixes/modules/core/src/flex/messaging/io/amf/Amf3Input.java
        blazeds/branches/4.0.0_fixes/modules/core/src/flex/messaging/io/amf/Amf3Output.java
        blazeds/branches/4.0.0_fixes/modules/core/src/flex/messaging/io/amf/AmfIO.java

    Revision: 20586
    Revision: 20586
    Author:   [email protected]
    Date:     2011-03-03 13:44:51 -0800 (Thu, 03 Mar 2011)
    Log Message:
    backporting nest object level fix and nest collection level fix from blazeds trunk to 4.0.0.fixes branch
    checkintests pass
    Modified Paths:
        blazeds/branches/4.0.0_fixes/modules/common/src/flex/messaging/errors.properties
        blazeds/branches/4.0.0_fixes/modules/core/src/flex/messaging/endpoints/AbstractEndpoint.j ava
        blazeds/branches/4.0.0_fixes/modules/core/src/flex/messaging/io/SerializationContext.java
        blazeds/branches/4.0.0_fixes/modules/core/src/flex/messaging/io/amf/Amf0Input.java
        blazeds/branches/4.0.0_fixes/modules/core/src/flex/messaging/io/amf/Amf0Output.java
        blazeds/branches/4.0.0_fixes/modules/core/src/flex/messaging/io/amf/Amf3Input.java
        blazeds/branches/4.0.0_fixes/modules/core/src/flex/messaging/io/amf/Amf3Output.java
        blazeds/branches/4.0.0_fixes/modules/core/src/flex/messaging/io/amf/AmfIO.java

  • Generic Dump Nested Collection Procedure?

    Greetings,
    Anyone have a proc which when passed a (possibly deeply) nested collection will dump a pretty-printed representation via dbms_output?
    I know this is a mostly just a typing exercise using recursion, but
    1. my PL/SQL skills apparently aren't up to the task
    2. I don't see any kind of get_type() function for the dump proc to use to decide how to loop through sub-collections
    so I'd like to see how the experts do it.
    Am using 10g.
    Thanks,
    --jim
    example:
    DECLARE
      TYPE numset_t IS TABLE OF NUMBER;
      TYPE numset_t_aa IS TABLE OF numset_t INDEX BY VARCHAR2(16);
      TYPE numset_t_aa_v IS VARRAY(2) OF numset_t_aa;
      n_aa numset_t_aa;
      n_t_aa_v numset_t_aa_v;
    BEGIN
      n_aa('tens') := numset_t(10,11,12);
      n_aa('ones') := numset_t(1,2,3);
      n_t_aa_v(1) := n_aa;
      n_aa.DELETE('ones');
      SELECT * BULK COLLECT INTO n_aa('hundreds') FROM table(numset_t(103,102,101));
      n_t_aa_v(2) := n_aa;
      dbms_output('dumping n_t_aa_v:');
      dump_collection(n_t_aa_v);
    END;expected output:
    dumping dumping n_t_aa_v:
    1:
      tens:
        1: 10
        2: 11
        3: 12
      ones:
        1: 1
        2: 2
        3: 3
    2:
      tens:
        1: 10
        2: 11
        3: 12
      hundreds:
        1: 103
        2: 102
        3: 101

    Hi,
    Why are you using collections in the first place?
    If the sole purpose here is to generate XML, then you don't need collection at all, just query your base tables with SQL/XML functions.
    If these collections are part of a larger process (besides generating XML), then you'll need to use at least SQL types instead of local PL/SQL types if you want to efficiently generate XML out of them.
    For example, using the XMLType constructor over the topmost object : {message:id=10012696}

  • Exported nested collection only saving schema, not data?

    Robin proposed an answer of exporting multiple collections into one:
    http://social.technet.microsoft.com/Forums/en-US/3c55b873-a0c7-4cc8-9bab-eaf809f62ab0/exporting-data?forum=projectsiena
    It seems to work as long as you immediately import - this is because the collection is still in memory.  If you exit the app (or clear the collection), then only the schema can be loaded because the data itself isn't saved.
    When I look into the .zip file, I see that the schema is being written but no underlying data.
    Perhaps I'm doing something wrong and that's why I'm only getting the schema?
    I would be happy to share the project I've been working on if that would be helpful.
    Thanks!
    Thor

    thorwm,
       I was initially experiencing the same issue, but it turns out I was just confused (again).   I was building the nested collection during the OnSelect event for the Export control.   Apparently, the OnSelect event happens
    AFTER the Export control performs the export.   This can be seen by simply doing the export twice.  
       I have to look at a better way to perform the nested collection process.   Hopefully this is the same issue you are experiencing.
    -Bruton

  • How can I avoid "NoSuch ElementException"  by nested collections

    I have been getting NoSuchElementException being thrown when iterating through nested HashSet. the code is as follows:
    for(int cols = 0; cols < arr.length; cols++){
          System.out.println("running for column " + cols);
          arrTemp1 = arr[cols];
          System.out.println("total size of template set "+ arrTemp1.size()+" for column "+cols);
          arrTemp2 = arr[cols+1];
          Iterator it1 = arrTemp1.iterator();
          Iterator it2 = arrTemp2.iterator();
          while(it1.hasNext()){
               String s = (it1.next()).toString();
               //System.out.println("printing template "+ s);
            String detector = s;
            while (it2.hasNext()){     
                 String sLeft = getLeftChild(s);
                 //System.out.println("left child of template "+ sLeft);
                 String sRight = getRightChild(s);
                 //System.out.println("right child of template "+ sRight);
                 if(sLeft.equals((it2.next()).toString())){
                     detector += sLeft.substring((sLeft.length() - 1));
                     System.out.println("detector "+ detector+" created from child "+ sLeft);
                 }else if(sRight.equals((it2.next()).toString())){
                     detector += sRight.substring((sRight.length() - 1));
                     System.out.println("detector "+ detector+" created from child "+ sRight);
               }//end while  
               if (detector.length() == noBits){
                System.out.println("detector "+ detector+" created from "+ s);     
                detectors.add(detector);       
          }//end while     
         }//end for     

    for(int cols = 0; cols < arr.length; cols++){
       arrTemp2 = arr[cols+1]; // cols+1 = arr.length !!!!

  • Nested Collections

    Hello All,
    I have a small program which im doing to learn more about Java. basically I have 2 JList called List1 and List2.
    List1 has to be sorted, so I put the items inside a treeset and when I add items they are sorted, so thats sorted.
    I did the same for List2 and worked as well. Now here comes the problem.
    List1 will contain household items, while list 2 will contain their properties. I want to do this using collections so I learn more about them so I did a treeset for the Items in List1, and this is the hard bit.. I want to CREATE a NEW arraylist or hashset, FOR EACH ITEM in List1 inorder to hold their properties and show them in List2. Once I click on another item in List1, List 2 will show me the properties of that item and so one..
    In short, I would like to to have a collection for each item in List1 and with 2 buttons I want to be able to add and remove. Its good to say that I have already implemented the buttons and I can add and remove from both lists, its justs the linking between them that I need.
    Thanks all

    I see.. I didn't know
    Well this is what I am doing.
    //Create a string called propertiesEntry to store the name of the property to be added               
    String propertyEntry = getUserInput();
    //Call the addProperty method and send the JList, selected item and property name as parameters
    property.addProperty(propertyList, (String)itemList.getSelectedValue(), propertyEntry);The first line calls a method which basically shows a JoptionPane and returns with a string that the user entered.
    The second line grabs the List to be modified, the item selected from List1 and the new property that has to be added in that list of the selected item. Meaning, the addProperty class must create a new arrayList combined with the item, and add the property to it.. If the arrayList already exists, than it only adds the property.
    After the list is emended, it returns the modified list. (I have already made this work but not 2 lists combined together..
    So in short, I would like somone to point me to an example or idea of HOW shall I create a new ArrayList and keep it linked with the selected item from List1.
    Hope this helps
    thanks very much

  • How can I update an object and its nested collection- Agengy, SMP 3.0

    Hello Gurus,
    I have two objects: PurchaseOrders and PurchaseItems. 1 PurchaseOrder has more than 1 PurchaseItems. In my Java code, I create a Item array in PurchaseOrder object to store the PurchaseItems.
    What I want to do is to update the PurchaseOrder object. There are 2 things I have to do:
    Update PurchaseOrder object.
    Update an existing PurchaseItem of the PurchaseOrder and/or create a new PurchaseItem of that PurchaseOrder?
    I already created a Bapi Java class to edit a selected PO and every Item of that PO on my device.
    What should I do next with the Agentry? Any help is appreciated.. Thank you very much.

    The process is virtually identical.  The only difference will be in your BAPI logic which you have already written.  You will connect it just like you are doing for the Add scenario.  Once you get that working this should follow a very similar pattern.
    --Bill

  • Populated nested collections

    Say I have two database tables, users and widgets. A user may have 0 or many widgets. So the tables look like this:
    users:
    userId   username
      1       One
      2       Two
      3       Threewidgets:
    widgetId   userId
      1          2
      2          3
      3          3So this means user One has 0 widgets, user Two has 1 widget and user Three has 2 widgets
    So I want to map this data into Java, so I have an Object like this
    public class User {
        private int id;
        private String name;
        private Set widgets = new LinkedHashSet();
        //Assume getters and setters for id and name
        public void addWidget(Integer widgetId) {
            widgets.add(widgetId);
    }Then I have JDBC code that executes this query:
      SELECT u.userId as id, u.username as name, w.widgetId
        FROM users u, widgets w
       WHERE u.userId = w.userId(+)
    ORDER BY u.useridThis would get the widgets for a each user. You need the outer join because I still want to create a User object even if the user has no widgets. So the result from the query is:
    id  name   widgetId
    1  One
    2  Two     1
    3  Three   2
    3  Three   3So then I want to have code that goes through the ResultSet and create a Set of User objects, one object for each user with the widgets Set of each User object populated with the widgetIds. The contents of the Set would be like this:
    id=[1],name=[One],widgets=[]
    id=[2],name=[Two],widgets=[[1]]
    id=[3],name=[Three],widgets=[[2],[3]]But my question is how do you get that? If you do this:
    //This will hold the Users
    Set set = new LinkedHashSet();
    //Assume ps is a PreparedStatement that will get the ResultSet
    ResultSet rs = ps.executeQuery();
    //This will hold each User
    User user = null;
    while(rs.next()) {
        user = new User();
        user.setId(rs.getInt("id"));
        user.setName(rs.getString("name"));
        user.addWidget(new Integer(rs.getInt("widgetId")));
        set.add(user);
    }That will get 2 user objects for user 3. I could create the equals() and hashCode() methods for User, but then how can I call addWidget() on the user that is already in the set when I get to the 2nd record in the ResultSet for user 3? Should I do this? (replace the set.add(user) from above with this)
    //Assuming I have the equals() and hashCode() methods for User
    //set.add() will return false if the user is already in the set
    if(!set.add(user)) {
        Iterator i = set.iterator();
        User tmpUser = null;
        while(i.hasNext()) {
            tmpUser = (User)i.next();
            if(user.equals(tmpUser) {
                tmpUser.addWidget(rs.getInt("widgetId"));
                break;
    }Would that even work? Is there a better way?

    OR or or or
    you use join so you have unique key (u.userId) so you can do this on the server side(and this is very good idea) as you don this before
    using yours query:
    SELECT u.userId as id, u.username as name, w.widgetId
    FROM users u, widgets w
    WHERE u.userId = w.userId(+)
    ORDER BY u.userid
    you have always sorted data so you do not have to use hashMap , you should write simple state machine
    private static User prevUser;
    Integer tmpInt;
    while (rs.next()) {
         user = new User();
         user.setId(rs.getInt("id"));
         user.setName(rs.getString("name"));
         // simple temporary buffer because rs.getInt("widgetId") should be readed only once  
            tmpInt = new Integer(rs.getInt("widgetId"));
          * This is your state machine
          * for the first  loop prevUser = null so
          * user.equals(prevUser) will return fals
             * you have to do the check in your equals method in User class
         if (user.equals(prevUser)) {
              prevUser.addWidget(tmpInt);
         } else {
              user.addWidget(tmpInt);
              set.add(user);
              prevUser = user;
    public class User {
    * equals method in User class
    public boolean equals(User myUser) {
         if (myUser == null)
              return false;
         else if (this.id == myUser.getId())
              return true;
         return false;
    } // end of User classgood luck

  • Nested collections - Esp., TreeMap problem

    I am a little frustrated. Please take a look at this.
    I have a class for comparison. This is pretty simple; just do the opposite of natural TreeMap for Integer and Double.
    ============================
    package parseagain;
    import java.util.Comparator;
    public class ReverseComparator<T> implements Comparator<T> {
         public int compare(T o1, T o2) {
              if (o1 instanceof Integer) {
                   if ((Integer)o1 < (Integer)o2) return 1;
                   else if ((Integer)o1 == (Integer)o2) return 0;
                   else return -1;
              else if (o1 instanceof Double) {
                   if ((Double)o1 < (Double)o2) return 1;
                   else if ((Double)o1 == (Double)o2) return 0;
                   else return -1;
              else {
                   throw new ClassCastException();
    ==============================
    Then, I have a long program, part of which is shown below. What it does is that put pixel information into a HashMap of TreeMap, then retrieve them. you know what? this prints 'NULL' like shown below it.
    ==============================
              HashMap<Integer, TreeMap<Integer, Integer>> colorXY = new HashMap<Integer, TreeMap<Integer, Integer>>();
              if (direction == 1) {
                   for (Integer iColor : colorsDrawing) {
                        System.out.printf("iColor is %d\n", iColor);
                        colorXY.put(iColor, new TreeMap<Integer, Integer>(new ReverseComparator<Integer>()));
              else {
                   for (Integer iColor : colorsDrawing)
                        colorXY.put(iColor, new TreeMap<Integer, Integer>());
              HashSet<Integer> temp = new HashSet<Integer>();
              for (int xi = left + 1; xi < right; xi++) {
                   colorsMet.clear();
                   for (int yi = top + 1; yi < bottom; yi++) {
                        int color = colors[yi][xi];
                        if (yi > posZero) {
                             color = (color * -1) - 1;
                             //System.out.printf("in color is %d\n", color);
                        // if this color is not what I want, skip.
                        if (colorsDrawing.contains(color) == false) continue;
                        if (color >= 0) {
                             // if upward, check if I already have it.
                             if (colorsMet.contains(color) == true) continue;
                             colorsMet.add(color);
                        colorXY.get(color).put(xi, yi);
                        if (xi == 694) {
                             temp.add(color);
                             System.out.printf("color: %d xi: %d yi: %d\n", color, xi, yi);
                   if (xi == 694){
                        for (Integer iColor : temp)
                        System.out.println("temp " + colorXY.get(iColor).get(xi) + " " + iColor);
    ==============================
    Here is the output:
    ==============================
    iColor is -8913033
    iColor is 16119285
    iColor is 8913032
    iColor is 16711680
    iColor is 65280
    iColor is -137
    iColor is -34817
    iColor is 255
    iColor is -8912897
    color: 8913032 xi: 694 yi: 139
    color: 255 xi: 694 yi: 142
    color: 65280 xi: 694 yi: 176
    color: 16711680 xi: 694 yi: 207
    color: 16119285 xi: 694 yi: 212
    color: -8912897 xi: 694 yi: 213
    color: -8912897 xi: 694 yi: 214
    color: -8912897 xi: 694 yi: 215
    color: -8912897 xi: 694 yi: 216
    color: -137 xi: 694 yi: 217
    color: -137 xi: 694 yi: 218
    color: -137 xi: 694 yi: 219
    color: -137 xi: 694 yi: 220
    color: -137 xi: 694 yi: 221
    color: -34817 xi: 694 yi: 222
    color: -137 xi: 694 yi: 223
    color: -137 xi: 694 yi: 224
    color: -137 xi: 694 yi: 225
    color: -137 xi: 694 yi: 226
    color: -137 xi: 694 yi: 227
    color: -137 xi: 694 yi: 228
    color: -137 xi: 694 yi: 229
    color: -8913033 xi: 694 yi: 230
    color: -8913033 xi: 694 yi: 231
    temp null -8913033
    temp null 16119285
    temp null 8913032
    temp null 16711680
    temp null 65280
    temp null -137
    temp null -34817
    temp null 255
    temp null -8912897
    ==============================
    It can't happen! I already put (several times)! Can anyone tell me why?

    Thanks. It worked fine.
    I also thank you for the comments on "the next
    thread." I will not do that again.
    I don't use forum before, so just understand me.No problem. Glad my suggestion worked for you.

Maybe you are looking for

  • Cannot delete locked .INF file from desktop

    Okay, I go to a school where everyone can place everything into one server. Someone put an autorun.inf virus in all the folders, including mine. I ended up having the virus on my flashdrive, but wasn't able to delete it through a PC. A friend said th

  • Creation of deliveries automatically in VA02

    Hi, I am creating a sales order , in my customized program  . Now i open the transaction VA02 , with the sales otder created. now i save this , now i get the nessage that "the delivery was created ". My requirement is that , the deliveries should be

  • My computer can't read raw files from my nikon d4s in Photoshop cs6

    Hello, i have a MacBook Pro and have Os X 10.8.5 installed Photoshop CS6 can't open the raw files from my Nikon D4S. I tried to install Adobe CameraRaw 7.1 but keep getting error messages. ALso tried to install the patch to no avail. Any suggestions?

  • Confusion over permissions authentication in Get Info...

    Hi, It just occurred to me I've never satisfied myself as to why, when attempting to alter the permissions on a file or folder that the current user owns and has read/write privileges to, it is necessary to authenticate using an Admin username and pa

  • How to hide line in Oracle 6i Reports

    Hi All, I have developed new report, in the report i need to hide line, at the timing of printing line should not print. Can any one help me this issue. Siva