CHAPTER 3 Domain models and metadata We won t (Anonymous web server)
CHAPTER 3 Domain models and metadata We won t consider dynamic models or XML representation again in this book. Instead, we ll focus on static persistent classes and how they are mapped. 3.5 Summary In this chapter, we focused on the design and implementation of a rich domain model in Java. You now understand that persistent classes in a domain model should to be free of crosscutting concerns, such as transactions and security. Even persistence- related concerns should not leak into the domain model implementation. You also know how important transparent persistence is if you want to execute and test your business objects independently and easily. You have learned the best practices and requirements for the POJO and JPA entity programming model, and what concepts they have in common with the old JavaBean specification. We had a closer look at the implementation of persistent classes, and how attributes and relationships are best represented. To be prepared for the next part of the book, and to learn all the object/relational mapping options, you needed to make an educated decision to use either XML mapping files or JDK 5.0 annotations, or possibly a combination of both. You re now ready to write more complex mappings in both formats. For convenience, table 3.1 summarizes the differences between Hibernate and Java Persistence related to concepts discussed in this chapter. Table 3.1 Hibernate and JPA comparison chart for chapter 3 Hibernate Core Java Persistence and EJB 3.0 Persistent classes require a no-argument constructor with public or protected visibility if proxy- based lazy loading is used. The JPA specification mandates a no-argument constructor with public or protected visibility for all entity classes. Persistent collections must be typed to interfaces. Hibernate supports all JDK interfaces. Persistent collections must be typed to interfaces. Only a subset of all interfaces (no sorted collections, for example) is considered fully portable. Persistent properties can be accessed through fields or accessor methods at runtime, or a completely customizable strategy can be applied. Persistent properties of an entity class are accessed through fields or accessor methods, but not both if full portability is required.
We recommend high quality webhost to host and run your jsp application: christian web host services.