I have the following requirement: the user wishes to see a listing of ProfileItem's, each of which has an enumeration property: ProfileType, one of five possible types. The listing contains a 'detail' column which depends on the ProfileType. For example, if the ProfileType is name, I'd have to join with contact details table and show the name as detail. If it's corporate ProfileType, I'd have to join with the company table and show COMPANY's name as detail. So on.. There is sorting and filtering on the detail column so I'd really like to have HQL handle this conditional mapping. Any ideas on how this could be achieved?
|