-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Recommended design to store messages and their headers
PostPosted: Mon Jun 08, 2009 5:11 am 
Newbie

Joined: Mon Jun 08, 2009 4:32 am
Posts: 3
Hello all,

This post is about property lazy fetching. I'm migrating one of our application from our own persistence system to Hibernate. This app store, transform and process messages between several partners. We are using only one table to store the messages (in a blob field) with their header data.
We often need to load only the header data without the message payloads and I'm not sure what is the best way to do that. I've read different things and thought about different scenarios :

1/ Use the lazy property fetching but §19.1.7 of Hibernate documentation don't recommend that. Moreover, I'm prefer not having additionnal buildtime bytecode.
2/ Still in §19.1.7, it is suggested to use projections features of HQL and Criteria queries but I don't understand how to solve my problem with that...
3/ Remove the payload property from the main Entity, create a second second one with only the primary key and the payload, mapped on the same table and make a one-to-one association between these two entities.

Could you help me to understand which one is the best scenario for us or maybe to tell me if I didn't understand something in the lazy property fetching mechanism.

Here is a simplified description of the table :

id (int) : internal message ID, 1 byte, PrimaryKey
senderId (string) : message sender id, few bytes
receiverId (string) : message receiver id, few bytes
document id (string) : business document id, few bytes
documentType (string) : type of the document, few bytes
documentFormat (string) : format of the document, few bytes
payload (blob) : the entire gzipped document, often > 100ko

Thanks for your help


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.