Well, you're getting the identifier, as specified in the mapping file, so it's working as it's supposed to.
Why not just do a criteria query? It would make life so much easier, and it would allow you to work with your objects - you could just call the getRecordId or getMessageId or whatever method/property call that you want on the object returned by the Hibernate Session.
Here's a little tutorial I put together on working with one to may associations with Hibernate:
Mapping One-to-Many Associations with Hibernate3
And here's another little learning guide to quickly get you up to speed on the Hibernate Criteria API:
Examples of the Hibernate3 Criteria API: A Tutorial
Hope this help you out and gives you some ideas!