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: Forcing bytea for Blobs in Postresql
PostPosted: Wed Dec 10, 2008 7:17 am 
Newbie

Joined: Wed Dec 10, 2008 6:39 am
Posts: 6
Hello, I'm writing a JEE application and I'm planning to support Glassfish and JBoss in their default configurations, so I need to support Toplink and Hibernate. I know that I can use Hibernate with Glassfish but I'd like my code to work in more than one JPA implementation, so using Hibernate in Glassfish would be a Plan B.

I have a table in a PostgreSQL database with a field that will store binary data. Using Toplink to generate the table, I get a field of type bytea and so, I read the data directly. This is the behavior I want since my binary field will not be very large and having it in the same table that I insert, will simplify the management for me.
When I try to run this application in Hibernate, I get an error saying that it expected the column to be of type oid while it is of type bytea. Is there a way to force Hibernate to recognize the column with its type?

I mean, there are two ways to store binary blobs in PostgreSQL, one with bytea columns and another with oid columns as specified in http://jdbc.postgresql.org/documentatio ... -data.html. Can I force Hibernate to use the first approach instead of the second one?


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.