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: Persisting a List of Value Objects with Value Objects
PostPosted: Tue Mar 06, 2007 12:25 pm 
Newbie

Joined: Fri Sep 01, 2006 8:45 am
Posts: 9
Hello.

My EntityObject (Contract) has a List of ValueObjects (Contact) in Contact are other ValueObjects (Address and CommunicationData) and i want to map this.
If've tried that:

Code:
    <bag name="ContactPersons" cascade="all">
      <key column="ContractGuid" />
      <composite-element class="ContactPersons">
        <property name="CompanyName" column="ContactPersonCompanyName" type="String" length="50" not-null="false" />
        <property name="Firstname" column="ContactPersonFirstname" type="String" length="50" not-null="false" />
        <property name="Surname" column="ContactPersonSurname" type="String" length="50" not-null="false" />
        <property name="Salutation" column="ContactPersonSalutation" type="String" length="50" not-null="false" />
        <property name="Role" column="ContactPersonRole" type="String" length="50" not-null="false" />
        <property name="DateOfBirth" column="ContactPersonDateOfBirth" type="String" length="10" not-null="false" />
        <property name="TaxOffice" column="ContactPersonTaxOffice" type="String" length="50" not-null="false" />
        <property name="TaxId" column="ContactPersonTaxId" type="String" length="50" not-null="false" />
        <property name="SalesTaxId" column="ContactPersonSalesTaxId" type="String" length="50" not-null="false" />
        <property name="TradeRegister" column="ContactPersonTradeRegister" type="String" length="50" not-null="false" />
        <property name="WantsNewsletter" column="ContactPersonWantsNewsletter" type="Boolean" not-null="false" />

        <component name="ContactAddress" access="field.camelcase-underscore">
          <property name="Street" column="ContactPersonStreet"  type="String" length="50" not-null="true" />
          <property name="Postcode" column="ContactPersonPostcode" type="String" length="50" not-null="true" />
          <property name="City" column="ContactPersonCity" type="String" length="50" not-null="true" />
          <property name="Country" column="ContactPersonCountry" type="String" length="50" not-null="false" />
          <property name="FederalState" column="ContactPersonFederalState" type="String" length="50" not-null="false" />
        </component>

        <component name="ContactCommunicationData" access="field.camelcase-underscore">
          <property name="TelephoneAreaCode" column="ContactPersonTelephoneAreaCode" type="String" length="50" not-null="false" />
          <property name="TelephoneNumber" column="ContactPersonTelephoneNumber" type="String" length="50" not-null="false" />
          <property name="MobilePhoneAreaCode" column="ContactPersonMobilePhoneAreaCode" type="String" length="50" not-null="false" />
          <property name="MobilePhoneNumber" column="ContactPersonMobilePhoneNumber" type="String" length="50" not-null="false" />
          <property name="FaxAreaCode" column="ContactPersonFaxAreaCode" type="String" length="50" not-null="false" />
          <property name="FaxNumber" column="ContactPersonFaxNumber" type="String" length="50" not-null="false" />
          <property name="Email" column="ContactPersonEmail" type="String" length="50" not-null="false" />
          <property name="Webaddress" column="ContactPersonWebaddress" type="String" length="50" not-null="false" />
        </component>
      </composite-element>
    </bag>


but it doesn't work.

Can anyone help me please?

regards
Kesch


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.