Hibernate Question about Component

  • Thread starter chris.fauerbach
  • Start date
C

chris.fauerbach

All -

I'm fairly new to Hibernate and have thoroughly read the Hibernate in
Action as well as the online Hibernate document and the xdoclet
documentation (hoping that would give me a clue!)

I have a question about the <component> tag. The example in this book
has to do with a person and their addresses. Fine, no problem. You end
up with a person xml file like this

<class name="person" table="person">
<id ...../>
<property name="personName"....../>
<component name="homeAddress" class="Address">
<property name="street" type="string" column="homeStreet"/>
</component>
......
</class>


a lot was obviously cut out, but the important part is the component.
Does the "Address" class need to be defined as a hibernate class? ( I
think the answer is no, but I'm not sure). Any ideas why this wouldn't
work?

In my application, I have a fully qualified class where address is..
e.g. com.my.company.Address
When I change it to just address I get a hibernate error saying
classdefnotfound (which is a goood thing)

So my setHomeAddress method on my person never gets called. Or does
hibernate work the other way and just set properties on a get? (i'll
try this next so don't really bother to answer that part, I just
thought of that. OK that didn't work).


Any thoughts on why this wouldn't work?
 
C

chris.fauerbach

Yeah just ignore my entire thought process. My data was wrong.
(stupid me)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,142
Latest member
arinsharma
Top