-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: xml without collection
PostPosted: Fri Dec 16, 2005 8:34 am 
Newbie

Joined: Thu Dec 15, 2005 12:33 pm
Posts: 5
hi,

i have the following xml tree:

Code:
<root>
    <name/>
    <node>
        <id>1</id>
        <xyz>string1</xyz>
    </node>

    <node>
        <id>2</id>
        <xyz>string2</xyz>
    </node>
</root>


this structure doesn't change, so i've always two of the nodes "node" (i call them node a and node b). is possible now that i have the following flat database schema (everything in one table)?

- root_id
- name
- id_a
- xyz_a
- id_b
- xyz_b

i've tried this with two component elements, like

Code:
<component name="Node1" node="node">
    <property name="id" node="id" column="id_a"   type="string"/>
    ...
<component>
<component name="Node1" node="node">
    <property name="id" node="id" column="id_b"   type="string"/>
    ...
</component>


but, unfortunately then i get just the second node in my result tree (i'm just reading from the database).
is there any possibility to map this tree to one db table?



thanks.[/code]


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 19, 2005 2:52 am 
Newbie

Joined: Thu Dec 15, 2005 12:33 pm
Posts: 5
nobody any idea? :-/


Top
 Profile  
 
 Post subject: Re: xml without collection
PostPosted: Mon Dec 19, 2005 3:14 am 
Senior
Senior

Joined: Tue Aug 23, 2005 8:52 am
Posts: 181
Im not sure i understand the question fully, but in any case, this seems a little awkward.

chummer wrote:
<component name="Node1" node="node">
<property name="id" node="id" column="id_a" type="string"/>
...
<component>
<component name="Node1" node="node">
<property name="id" node="id" column="id_b" type="string"/>
...
</component>

shouldnt the second one be
[code]
<component name="Node2" node="node">
<property name="id" node="id" column="id_b" type="string"/>
...
</component>
</code]


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 19, 2005 4:29 am 
Newbie

Joined: Thu Dec 15, 2005 12:33 pm
Posts: 5
yes, of course should it be "Node2". copy and paste error. ;-)
but the important thing is the node attribute. if i have two different node names, everything works fine. if i have the same node name for both components, only one component is shown. i guess the first one is overwritten by the second one.

so, i've tried to do something now with a "set" and "composite-element". but up to now i havn't found something which helps me.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.