The application shouldn’t necessarily need to care that an object is persistent when invoking its methods. Although some of the material may be formal, a solid understanding of the persistence lifecycle is essential.īecause Hibernate is a transparent persistence mechanism-classes are unaware of their own persistence capability-it’s possible to write application logic that is unaware whether the objects it operates on represent persistent state or temporary state that exists only in memory. Let’s start with persistent objects, their lifecycle, and the events which trigger a change of persistent state. Of course, you can skip quickly through this material if you aren’t working with Java Persistence or EJB 3.0-we encourage you to read about both options and then decide what is better for your application. The main Java Persistence interface in EJB 3.0 is called EntityMan-ager, and thanks to its close resemblance with Hibernate APIs, it will be easy to learn alongside. The Hibernate persistence manager, the Session, is responsible for managing object state, so we discuss how to use this important API. In this topic, we discuss the lifecycle of objects-how an object becomes persistent, and how it stops being considered persistent-and the method calls and other actions that trigger these transitions. In our experience, many developers are only really aware of the structural mismatch and rarely pay attention to the more dynamic behavioral aspects of the mismatch. We consider these problems to be at least as important as the structural problems discussed in previous topics. This and the following topics cover the behavioral aspect of the object/relational mismatch. You basically have learn how to control the state of objects. You must investigate strategies for runtime data access, because they’re crucial to the performance of your applications. With what you know so far, it’s possible to solve the structural mismatch problem, but an efficient solution to the problem requires something more. * This class represents a persistent class for Student.You now have an understanding of how Hibernate and ORM solve the static aspects of the object/relational mismatch.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |