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 8168297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:28:37+00:00 2026-06-06T20:28:37+00:00

I read the Hibernate Envers doc, but didn’t understand how I can get the

  • 0

I read the Hibernate Envers doc, but didn’t understand how I can get the following to work:

I have two entities: Address and Order. Order has an Address.

When an order is created, I want it to stick to the current address revision, so if the same address changes (generating a new revision), the order still points to the address revision it had when it was created.

How can I achieve this?

  • 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-06T20:28:38+00:00Added an answer on June 6, 2026 at 8:28 pm

    That’s not possible with Envers, and in fact that’s not what Envers is made for.

    In your case you have two distinct Address “identities” – the old one and the new one. Hence they should be separate entities. It’s not the same Address entity that changes.

    You could then use Envers to keep track of how the relation changes. Say you have order O, and address A1 and A2. Initially the relation is: O->A1. But then when the address changes, you can change the relation to: O->A2, and that will be reflected in history.

    However, when you read the entities, you always get the newest version. A “current” entity can’t point to a historic entry.

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

Sidebar

Related Questions

I read this tutorial . I try, but i get error. We have Mysql
I have created very simple app with persistence context (hibernate as provider) to read
I have already read the hibernate docs about concurrency and I think, I have
I am using hibernate. i have read some where about Example.create. what is it
I'm trying integrate spring with hibernate but catch NamingException: Context is read only stacktrace
I have a Java (6) application which uses Hibernate (V3.3.2) to read data from
From what I have read Hibernate should have been downloaded to the lib folder
I read that Hibernate can manually try to find appropriate dialect for a given
I have a JPA using Hibernate connected to SQLserver. It works but i have
I have read several tutorial concerning the for hibernate. I'm still getting confusion. Does

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.