Hi all,
I'm working on a project in which we are handling file upload/download.
I am thinking about an implementation that lets us upload and download files to and from the database using Hibernate, without ever holding the files in memory.
I'm wondering if there is a nice way to do this using Hibernate.
This is an example of what I would like to do:
Code:
Attachment attachment = ... (query attachment)
streamToClient(Attachment.getDataInput()) //Data is not in memory, but holds a stream to it.
and
save(File file) {
Attachment attachment = new Attachment();
streamToDB(Attachment.getDataOutput()) //Data is not in memory, but hold a stream to it.
}
Any help would be appreciated.