I want avoid updates undue with Ebean, because it happens to Hibernate(@Immutable) and EclipseLink(@ReadOnly).
Asked
Active
Viewed 4,063 times
0
-
1With Ebean you'd be best just to not have any setters on the entity bean - why don't you do that? – Rob Bygrave Nov 27 '14 at 01:15
-
It is an alternative. Nice! – Alfaville Nov 28 '14 at 05:16
-
1You can also use ... query.setReadOnly(true) on mutable beans but making the bean itself immutable by removing the setters would be a better approach imo. – Rob Bygrave Nov 30 '14 at 00:09
-
1Possible duplicate of [How to make an Entity read-only?](https://stackoverflow.com/questions/5115527/how-to-make-an-entity-read-only) – Software Engineer Feb 25 '19 at 20:52
1 Answers
1
So as an answer:
Just remove the setter methods and make the bean immutable that way.

Rob Bygrave
- 3,861
- 28
- 28
-
1Removing the setter doesn't work with collections. See this other topic http://stackoverflow.com/questions/5115527/how-to-make-an-entity-read-only – Xavier Bouclet Jun 07 '16 at 13:03