Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8990591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:31:56+00:00 2026-06-15T22:31:56+00:00

I have a webapp where users can upload files (via multipart/form-data ), and they

  • 0

I have a webapp where users can upload files (via multipart/form-data), and they get stored along with their metadata in a DB with Hibernate (@Entity class Document).

The target table has a BLOB column content where the contents of the files are saved. Users who upload files are then allowed to modify some of the metadata (e.g. the original file name) in a GWT-based UI. To that end, I use Dozer to convert Document instance into a ClientDocument instance, which does not have the content field and is serializable for GWT. Once a modified ClientDocument instance arrives from the browser, I convert it back into Document and execute this:

ClientDocument document = ...;
Document entity = dozerBeanMapper.map(document, Document.class);
Session session = sessionFactory.getCurrentSession();
session.merge(entity);

At this point the entity‘s content column gets cleared, since Dozer, obviously, did not fill in the corresponding BLOB data.

Is there any way to avoid updating this particular BLOB content column during merge()? I have seen Not committing an hibernate entity field to the DB, but the @Transient solution does not work for me, since I need to fetch the content BLOB for other operations in the backend.

Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T22:31:57+00:00Added an answer on June 15, 2026 at 10:31 pm

    You can tell Hibernate not to update the field at all

    <property name="fieldName" insert="true" update="false"/>
    

    Using annotations it will be something like this:

    @Column(insertable = true, updatable = false)
    

    Note, that the field is insertable which means it will be inserted, but next time you’re going to update the entity, it won’t be updated.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web application with an upload form where users can upload files.
I have a webapp where users can create their account and use the service.
I'm planning to build a webapp where users can show off their data. I
I have a web app where users can upload files. The files are physically
Our PHP/MVC webapp lets users upload pictures. They get a link for each image,
I have a web app where users can sign up, via Devise, and post
We have a CSV uploader where users can upload a CSV file filled with
I have a web-app that allows users to upload and download image files by
In my web application there will be several users. and they have their own
I am planning to create a webapp which user can upload mp3 files.So it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.