The change in EJB 3.0 specification can be roughly divided into 2: 1. The programming model of the Annotation mechanism provided in JDK1.5 is used. Similar functions are completed in EJB2.1 using some interfaces and deployment descriptors. EJB ANNOTATIONS All enterprise beans in EJB3 are Pojo (Plan Old Java Object) and some related descriptors. The descriptor can be used to define the information that the bean needs to be implemented, the information required to be required, and the resources needed to be referenced. 2. Provide a hibernate-based O / R mapping tool, and EJB QL has changed significantly. When an entity Pojo class and the EntityManager establish a relationship, this class is a class that can be instantiated, and a part of the context is instantiated. Although JB3.0 provides a new simpler programming method, it remains downward compatible, and the deployment descriptor and Home / Remote interface in EJB2.1 are still valid. Currently EJB3.0 support ANNOTATIONS includes: @ Entity @ stateless @ recote @ transactiontnessttribute @ Table @ ID @ Basic @ Column @mantoone @ oneTomany @Manytomany @ JoinColumn @ AssociationTable
An example of a state of BEAN A stateless session bean: A stateless bean code is as follows: import javax.ejb. *; @Stateless @Remote Public class helloWorldbean {public string shorto () {return "Hello World !!! EJB 3.0 by tcf ";}} Little explanation on the above code: The previous mentioned in EJB3.0 is a pojo, just add the related annotation. @StateLess means this is a stateless bean. @Remote means that this bean needs to implement the Remote interface, as the default is LOCAL.
Sustainable now RESIN has supported EJB3.0, everyone is interested, you can try it. Welcome to exchange
http: //www.jfox.cnhttp: //fancyhf.mblogger.cn/category/3691.aspxThe Unofficial EJB 3.0 FAQ Released summary notes (1) based system framework open source project JBoss EJB 3.0 Preview ReleaseSimplifying EJB development with EJB 3.0JBOSS CMP EJB development experience