Java Craziness
Annotating the entity’s instance variables directly avoids the overhead of method calls and provides a slight performance optimization, since the persistence manager talks directly to the fields. Annotating the property accessors provides a simple way for the Bean Provider to intercept and perform custom logic during all attempts to read and write property data.
This latter option affords the Bean Provider a chance to lazily derive persistent property values on demand, if desired. However, be aware that any validation or side-effect code on the property accessor methods will be called during entity state transitions. As you’ll see in the next chapter, if the Bean Provider wishes to initialize transient data or refine persistent data at the time the entity’s persistent state is first loaded, or prior to saving changes out to persistent storage, it is preferable to perform these steps using entity life cycle callback methods. Using the combination of field-level annotations and entity life cycle callbacks has the benefit that validation and other code in the setter methods will only be called when a client calls the setter, and not when the entity is being instantiated from persistent store by the framework.
Chances are that anyone reading this now probably doesn't understand a word. All sane people should have given up reading it half way through. I do have a quote for anyone who tries to make any sense of it, ignorance is bliss. Plus it really doesn't help that the author says something like "I'm not not holding a ear that isn't my left ear" rather than "I'm holding my right ear" Welcome to the world of bad prose. I'm sure all fields of knowledge try to hide information from outsiders this way, but is it really necessary? I mean the medical community has it's own style of communication, which to an outsider might as well be gibberish.
2 Comments:
And you actually get it now? Wow!
hey, Syed, I'm bill. long time no see. I miss you!
Post a Comment
<< Home