Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Immutable and read-only mappings(Can entities mapped as one-to-one avoid change detection and associated locks?)
Immutable and read-only mappings [message #1795883] Mon, 01 October 2018 17:36
David Mulligan is currently offline David MulliganFriend
Messages: 13
Registered: February 2010
Junior Member
Entity A has a one-to-one mapping to entity B which is read only and another one-to-one mapping to entity C which is to be immutable when accessed from entity A.

B is annotated with @ReadOnly. In A both B and C are annotated with @Mutable(false) yet they both seem to be considered for change detection and they both are locked when cloning etc.

Book has an Author and a BookType. BookType is a read only entity with HardCover, SoftCover, and Digital records only.
We will don't want to be able to update the author via a book, so never calling book.getAuthor().setName(). BookType has no setters at all.
Of course book.setAuthor(someNiceAuthor) or book.setBookType(hardCover) should be persisted to the book table but immutable when we get them from a book.

Is there any way to map them so they are immutable?
Previous Topic:Cache L2 sharing objects with managed entities
Next Topic:Factory create entitiymanager container
Goto Forum:

Current Time: Sun Jun 04 18:02:05 GMT 2023

Powered by FUDForum. Page generated in 0.01868 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top