-->
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.  [ 5 posts ] 
Author Message
 Post subject: Mapping InputStream
PostPosted: Sun Jan 15, 2006 1:55 am 
Regular
Regular

Joined: Thu Feb 17, 2005 1:58 am
Posts: 63
Can someone point me to some docs on how to map an inputstream?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 15, 2006 3:05 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
What's the relation with EJB3?

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 19, 2006 3:01 am 
Regular
Regular

Joined: Thu Feb 17, 2005 1:58 am
Posts: 63
Well,

byte[] getData()

can be quite inefficient, so if I have a InputStream getInputStream(), would Hibernate Annotation do the right thing and map the InputStream into a blob column by itself?

emmanuel wrote:
What's the relation with EJB3?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 20, 2006 7:02 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
and How should I map an inputstream partially read by the user application?

Try to implement a user type (@Type), this might work in your particular case.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 23, 2006 2:41 am 
Regular
Regular

Joined: Thu Feb 17, 2005 1:58 am
Posts: 63
emmanuel wrote:
and How should I map an inputstream partially read by the user application?

Try to implement a user type (@Type), this might work in your particular case.


Well, perhaps...as a simple default,

On the way into the DB, the user is responsible for keeping that inputstream live and valid and Hibernate will just read from the stream until there is no more data. Sure, there is the problem of resetting and be able to repeatedly read from that InputStream, but as a default, just assume a one-time read and process deal.

On the way out, just back it with a ByteArrayOutputstream.

I'll look at user type. Thanks...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.