-->
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 Images To DB
PostPosted: Sun Dec 11, 2005 10:20 pm 
Newbie

Joined: Wed Oct 26, 2005 5:28 am
Posts: 7
Location: Australia
Hi there, does anyone know how to map an image to the database? I am using postgresql.


Cheers,
Brad


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 12, 2005 9:46 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
You may use a Byte[]; read property mapping

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 12, 2005 7:59 pm 
Beginner
Beginner

Joined: Mon Aug 15, 2005 11:09 pm
Posts: 23
Yeah you'll want to use a Byte[] type on the object. For the hibernate mapping the Byte[] datatype works for small images but it will cut off large images and files. You'll need to use BinaryBlob from the Large Object Mapping Types to store larger files.

So you'll probably want to use the blob datatype for the postgresql column, Byte[] field on the object and set BinaryBlob on the NH property.

Ignoring the technical side of things I have always found it's better to store images and other files directly on the filesystem. It makes backup easier, it's faster, and the files are directly available to other systems.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 12, 2005 8:39 pm 
Newbie

Joined: Wed Oct 26, 2005 5:28 am
Posts: 7
Location: Australia
Thanks very much for your replies, it is greatly appreciated.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 11, 2009 10:56 pm 
Newbie

Joined: Wed Mar 11, 2009 10:08 pm
Posts: 4
You might want to check this out:

http://blog.calyptus.eu/seb/2009/03/lar ... and-xlobs/

Currently it's a work in progress but I'm actually working on an implementation of this for PostgreSQL Large Objects.


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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.