-->
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 persist serializabe to BLOB?
PostPosted: Fri Jul 07, 2006 4:32 pm 
Newbie

Joined: Fri Jul 07, 2006 10:06 am
Posts: 5
I want store a list of values into a single column as serializable object.

Hibernate maps serializable to RAW in Oracle.

The problems are:
1. RAW has fixed size which may consume a lot of meory if objects are small
2. RAW can store upto 2000 bytes which can not host any reasonable list of objects.

If I could map serializable to BLOB or LONG column, these two problems would have been solved.

Any thought?

Thanks, Paul


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 07, 2006 7:29 am 
Newbie

Joined: Mon Aug 07, 2006 7:20 am
Posts: 2
Hi,

you can overide the sql type which maps to a specific Hibernate type.

Just look at this code snippet... If you don't know the exact spelling of the desired type just go to the Hibernate sources and have a look into the database dialect class you're using in your config eg. org.hibernate.dialect.Oracle9Dialect

Code:
        <property name="original_data" type="binary" lazy="true">
          <column name="original_data" sql-type="long raw"/>
        </property>


Greetz
Benjamin


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.