-->
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.  [ 1 post ] 
Author Message
 Post subject: Collections of components of ...
PostPosted: Wed Feb 20, 2008 7:45 am 
Newbie

Joined: Wed Feb 20, 2008 7:16 am
Posts: 3
Hello,
I'm trying to map a list of parameter sets for an application. Because we want to transfer them via WebServices, I defined them in a XSD.

Code:
...
   <xsd:complexType name="ParameterListMetaData">
      <xsd:sequence>
         <xsd:element name="description" type="xsd:string" maxOccurs="1" minOccurs="0" />
         ...
      </xsd:sequence>
      <xsd:attributeGroup ref="base:Identifiable"></xsd:attributeGroup>
      ...
   </xsd:complexType>
   ...
   <xsd:complexType name="ParameterList">
      <xsd:complexContent>
         <xsd:extension base="this:ParameterListMetaData">
            <xsd:sequence>
               <xsd:element name="parameter-values" maxOccurs="unbounded" minOccurs="1" type="this:ParameterValues" />
            </xsd:sequence>
         </xsd:extension>
      </xsd:complexContent>
   </xsd:complexType>
   ...
   <xsd:complexType name="ParameterValues">
      <xsd:sequence>
         <xsd:element minOccurs="1" maxOccurs="unbounded" name="values" type="xsd:string" />
      </xsd:sequence>
   </xsd:complexType>

(It may seem strange that parameter lists contain of lists of value lists instead of complete name/value pairs, but it saves me to transmit redundant information as much as possible.)

So basically I have

A ParameterList which contains a list of ParameterValues
and
ParameterValues which contains a list of String.

Naturally the ParameterValues are no entities of their own and have no identifier property. I'd like them deleted when I delete the whole list and of course I'd like to be able to remove/manipulate entries from the list of ParameterValues.

The Java classes are generated with XJC so there are getters for the collections and I switched on the equals() and hashCode() extensions.

However, hibernate does seem to support collections of components (ParameterValues inside ParameterList) which themselves have collections of values (says the documentation Chapter 8.2 "Collections of dependent objects": "Composite elements may contain components but not collections.") and mapping the ParameterValues as a class causes an exception complaining that it does not define an identifier property.

Has anyone solved a similar problem without introducing an identifier property?


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

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.