Hi,
I have a polymorphic structure like this:
Code:
AbstractCustomer
/ \
PersonCustomer CompanyCustomer
-firstname -name
-surname
I have a getCustomerName() method in my AbstractCustomer class and it is implemented in extending classes. PersonCustomer returns a string "firstname surname" and CompanyCustomer just "name".
Now I would like to have a polymorphic reporting query against AbstractCustomer class. I would like to fetch the name and id of each customer. How should I map my classes so that this reporting query would return me the strings I want ("firstname surname" from PersonCustomer and "name" from CompanyCustomer)?
I tried to add
Code:
<property name="customerName" insert="false" update="false"/>
to the mapping of AbstractCustomer, but still I get for example "customerName" column to my DDL.
Any ideas/pointers?
Sincerely,
Jouni Hartikainen