Let's say I define a set of get and set functions for a given property in a class that gets handled by Hibernate. The set function is a public one which may be called by Hibernate's mechanisms as well as normal flow of code.
If the set function is called by Hibernate, it should just set the field's value. If the set is called by another source, it should also update additional fields accordingly.
Is there a way in code to differentiate between the two situations? Or, is there a better practice for handling this situation?