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

  • SEARCH
  • Home
  • 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 8206633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T08:44:38+00:00 2026-06-07T08:44:38+00:00

I am loading some hibernate objects through hibernate search and then showing them in

  • 0

I am loading some hibernate objects through hibernate search and then showing them in the UI. There, our user selects one object and removes some elements from a @ManyToMany association.

Of course, as written in the hibernate documentation when the session is flushed, changes are persisted automatically even if I don’t call Session#save in the object found.

But that is not the behavior I need. I need my user to remove the objects from the association but only temporally, only for making a report from the modified object without changing my database. So the removed objects in the association do not show in my report.

How can I make this happen?

I was thinking in mark the associated objects as Cloneable and build a new entity and make changes there as all the operation in this particular UI are read-only.

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-07T08:44:38+00:00Added an answer on June 7, 2026 at 8:44 am

    Mark the collection with cascade="evict". Then remove the objects as you like, generate your report, then evict() the object before flushing.

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

Sidebar

Related Questions

During a Hibernate Session , I am loading some objects and some of them
I'm loading some feeds and displaying them as links on my site page. When
In one of my HTML page dynamically loading some file field while clicking a
I have a MySQL table for persistence of some Java objects and use Hibernate
My Java Web application uses Hibernate to perform ORM. In some of my objects,
I am attempting to get Hibernate to lazy load some clobs. The loading portion
I have a problem when converting hibernate objects to JSON with Jackson, because some
I have some hibernate queries where I expect some objects to be eargerly loaded
I am loading some template files into my application using require.js like so: define(function(require)
I'm loading some HTML via Ajax with this format: <div id=div1> ... some content

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.