[Compass-developer] mapping problem
Brought to you by:
kimchy
From: matthew b. <bil...@ho...> - 2005-09-02 19:06:13
|
Hi! I am having problems with a parent-child mapping that should be simple but for the life of me I just cannot figure out what I am doing wrong! The mapping below works fine. I can query 'male' and all male people and staff are returned - fantastic! <compass-core-mapping> <class name="a.b.x.Person" alias="person"> <id name="id"/> <property name="gender"> <meta-data>gender</meta-data> </property> </class> <class name="a.b.x.Staff" alias="staff"> <id name="id"/> <property name="number"> <meta-data>number</meta-data> </property> <component name="identity" ref-alias="person"/> </class> </compass-core-mapping> When I advance a little using the mapping below I get stuck! I now query 'male' and get no hits returned. A query using initials that definitely exist in my database also returns no hits (I was hoping to get some people and staff returned). <compass-core-mapping> <class name="a.b.x.Person" alias="person"> <id name="id"/> <property name="gender"> <meta-data>gender</meta-data> </property> <component name="names" ref-alias="personName"/> </class> <class name="a.b.y.PersonName" alias="personName" root="false"> <property name="initials"> <meta-data>initials</meta-data> </property> </class> <class name="a.b.x.Staff" alias="staff"> <id name="id"/> <property name="number"> <meta-data>number</meta-data> </property> <component name="identity" ref-alias="person"/> </class> </compass-core-mapping> I have probably made a mistake somewhere (or missed the point). Any help or advice would be appreciated. Thanks - Matt |