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.

Example:
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: Thu Apr 25 09:13:35 GMT 2024

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

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

Back to the top