• 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

Hibernate mapping using Oracle XML

 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Before I begin with my problem let me explain my hibernate setup. Hope you will bare with me and not leave in the middle of the explanation .

I have a primary table called Automobile, with a secondary table called AutomobileDetails. The AutomobileDetails contain some attributes to connect to Automobile, and a string value which is an XML.

Some(not all) Automobiles have a connection to ONE AutomobileDetails.
I have defined a discriminator-value in the mapping to Automobile for those who do have such a connection. In this discriminator I have defined a <many-to-one> to the AutomobileDetails. This many-to-one is tied to the mapping of AutomobileDetails.



In the setter method for this automobileDetails I have an XML parser which goes through the XML string og populates the values in differenct variables in the mapped object.

I have discovered that Oracle can do this for me, but I am not sure how to set this up in my Hibernate mapping.

The following SQL is used to get a single value from this XML string


I could set up a <property formula=""/>, and define the SQL select in this formula for the test variable, but I need to pass two paramter in this formula from the primary keys of the hibernate mapping Automobile. Could I do this or is it some other way I could populate these variables with the values from this XML string?

Something like this maybe (:id1 and :id2 refers to the primary keys)?


In addition to retrieving the data in the AutomobileDetails I also want to update them when the Automobile object is stored. Volvo is a subclass of Automobile.
[ May 19, 2008: Message edited by: Sverre Moe ]
 
His brain is the size of a cherry pit! About the size of this ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic