Vừa được phát hành Enterprise JavaBeans 3 (EJB 3) đặc điểm kỹ thuật bao gồm một thành phần ORM bắt buộc. Hibernate của thiết kế chịu ảnh hưởng nhiều của những thay đổi (bao gồm cả kiên trì trọng lượng nhẹ và ngôn ngữ truy vấn). | 14 CHAPTER 2 INTEGRATING AND CONFIGURING HIBERNATE Annotations and Enterprise JavaBeans 3 The newly released Enterprise JavaBeans 3 EJB 3 specification includes a mandatory ORM component. Hibernate s design influenced many of the changes including lightweight persistence and the query language . The configuration requirements for Hibernate in an EJB 3 environment are somewhat different from the default requirements we discuss this in more depth in Appendix A. If you have used EJB or in the past you will find EJB 3 to be a much-needed simplification. Hibernate 3 permits you to take advantage of the new Annotations feature of Java 5. These annotations can be used in conjunction with or in place of some of the configuration files that previous versions of Hibernate demanded. These annotations are essentially an EJB 3 feature although Hibernate supplies some additional proprietary extensions. In Chapter 6 we discuss how to use these persistence annotations. JMX and Hibernate JMX is a standard API for managing Java applications and components mostly accessed through MBeans which represent wrappers for services and resources. Hibernate provides two MBeans for JMX HibernateServiceMBean and StatisticsServiceMBean. Both of these are interfaces that reside in the package. The HibernateService and Statisticsservice classes implement the interfaces and reside within the same package. The HibernateServiceMBean provides getter and setter methods for many of the Hibernate configuration properties including the data source transaction strategy caching dialect and other database options. It also provides a mechanism for adding mapping files to the configuration. When the HibernateServiceMBean starts it creates a Configuration object from its properties and mapping files and then builds a SessionFactory object. The SessionFactory object binds to the JNDI location specified on the JMX MBean and your Java application can then use standard JNDI calls to obtain