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: Need Hibernate-Postgres-Blob Help
PostPosted: Tue May 17, 2011 3:54 pm 
Newbie

Joined: Tue May 17, 2011 3:47 pm
Posts: 1
I have a file I would like to save as a Blob (or something similar) as a column in a Postgres table.

In my Hibernate mapping I refer to that column as type java.sql.Blob:

<property name="content" type="javax.sql.Blob">
<column name="content" />
</property>

From Java, when I get the record, I am getting a long back there which I guess is some sort of file handle.

I would appreciate it if someone would tell me how to define my Postgres table column and my Hibernate mapping so that the fetch will return the bytes in the (file) blob and not a long.

Thanks for any information you can provide!


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.