• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to do a Merge in a hibernate component

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello guys,

I have the following problem , CustomerVoucherAgreementImpl.class (table="E_VOUCHER_CUST_AGREEMENT") has a shared component(orderRelatedData) with his child CustomerVoucherAgreementImplCL.class (table="E_VOUCHER_CUST_AGREEMENT_CL"), and when I try to read a CustomerVoucherAgreementImplCL.class(the select statement is correctly executed and brings all the requested values), the orderRelatedData component sets to null the attributes filled by first join(E_VOUCHER_CUST_AGREEMENT).
The question is, How can I merge a component from 2 tables?.

E_VOUCHER_CUST_AGREEMENT table (CustomerVoucherAgreementImpl.class)


E_VOUCHER_CUST_AGREEMENT_CL table (CustomerVoucherAgreementImplCL.class)


CustomerAgreementOrderRelatedData.class



CustomerAgreementOrderRelatedDataCL.class


Thanks in advance.
 
Christian Carreno
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have found a really ugly way...

This case can be resolved by "formula", so, we have to concat the original alias and the column name.

<property name="maximumOrderRequestMonthDay" column="N_MAXREQUESTORDERMONTHDAY" type="integer" formula="customervo0_2_.N_MAXREQUESTORDERMONTHDAY" />



E_VOUCHER_CUST_AGREEMENT_CL table (CustomerVoucherAgreementImplCL.class)


Now we need to know if is it possible to define a static alias, when we define a table, for example, inside of a join element, obviously I saw the DTD and isn't possible, but maybe there is another way that you want to share with us. We know that the alias is defined by Hibernate and that's why we want to get the control of it.

Thanks in advance.
reply
    Bookmark Topic Watch Topic
  • New Topic