From: Urberg, J. <ju...@ve...> - 2002-07-16 15:31:22
|
I'm starting a new application I was hoping to start using Hibernate on. Sure enough, the first object I need to map is a "Narrow View" I'm creating for a list. It needs to join four tables (2 are the same table). The SQL would look something like this: select recipient.firstname, recipient.lastname, message.date, message.subject, sender.firstname, sender.lastname from message, user sender, message_box, user receipient where recipient.userid = ? and message_box.userid = recipient.userid and message_box.type = 1 and message.id = message_box.message_id and sender.id = message.senderid; I'd like the results to map to: class MessageListView { Name recipientName; Date date; String subject; Name senderName; } What would be involved in adding support for this in Hibernate? I don't need update capablities (at least not yet :) ). Thanks, John |