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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T17:16:25+00:00 2026-05-19T17:16:25+00:00

I have a transactional entity associated to another entity whereby the associated should not

  • 0

I have a transactional entity associated to another entity whereby the associated should not be updated in an case.

Eg. Case *-> User

Where a Case is owned by a User and reversely a User can have many associated Case.

The association is mapped using OneToMany and JoinColumn JPA annotations.

I have also tried marking the Trasactional annotation for User entity as readonly and also made the fetch methods Transient. But this doesnot seem to stop update on User if its state is changed.

Please help me a figure a way to declare a “read-only” association to User.

  • 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-05-19T17:16:26+00:00Added an answer on May 19, 2026 at 5:16 pm

    You can add updatable=falseon @JoinColumn annotation.

    Furthermore you should not add a setter method for user in your Case entity and same for caseSet in your User entity. The getter getCaseSet in User entity should also return an unmodifiable collection:

    public Set<Case> getCaseSet() {
        return Collections.unmodifiableSet(caseSet);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have transactional replication running between two databases. I fear they have fallen slightly
I have two tables which have some transactional stuff stored in them. There will
I have set up transactional replication between two SQL Servers on different ends of
I have a need to create a transactional process using an external API that
Curious whether folks have setup 2 way transactional replication on the tables ASP.NET uses
I have a WCF service that posts messages to a private, non-transactional MSMQ queue.
So I have an app that if I'm honest doesn't really need transactional integrity
In my data model I have a fairly common division between my objects/tables/data: Transactional
I have three methods: public void Save<T>(T entity) { using (new Transaction()) { Session.Save(entity);
I have the following jpa entity inheritance hierarchy: abstract Account ChildminderAccount extends Account ParentAccount

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.