-->
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.  [ 2 posts ] 
Author Message
 Post subject: How to serialize a file
PostPosted: Sun May 09, 2004 4:13 am 
Beginner
Beginner

Joined: Thu Mar 25, 2004 9:13 am
Posts: 20
What is the best way to serialize a file in hibernate. I have this object 'Attachment' which represent a file (such as ms-word), and I want to serialize it to my table. On Oracle the type will be BLOB, on MS-SQL this will be IMAGE and so on.

TIA Oren

_________________
Oren Gross


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 11, 2004 1:07 pm 
Regular
Regular

Joined: Thu Jan 29, 2004 10:34 am
Posts: 52
Location: Austin, TX
if Attachment implements Serializable, in which case the document object can be deserialized as-is if you simply mark it as a hibernate property (no type required)

@hibernate.property

the other option is to use the hibernate type 'blob'.

<property name="bigDocument" type="blob"/>
or,
@hibernate.property type="blob"

in which case you would have to deal with the associated blob semantics in the code


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

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.