EJB3.0 Draft learning notes (1)

zhaozj2021-02-16  124

EJB3.0 Draft learning notes (1)

Today, I will learn EJB3.0 Draft, and everyone may know, a stateful session bean is like this: @Stateful public class cartbean imports ShoppingCart {Private float Total; Private Vector ProductCodes; Public Int SomeshoppingMethod () {...} ; ... ejbremove () {...};} Other types, I don't have to say it ...

The interface of the Entity Bean is not specified in the interface, but the sesseion bean and MDB are definitely an interface. A bean class can implement one or more interfaces: / ** The bean class imports the Calculator Business Interface: * / @ stateless public class calculatorBean imports Calculator {public float add (int A, int b) {Return A B;} Public Float Subtract (int A, int b;}} public interface calculator {public float add (int A, int b); public float subtract (int A, int b);} If you do not implement an interface, the interface is automatically generated for it: / ** This class definition causes the Calculator * interface to be generated as a local business interface * This interface will have the methods add and subtract.*/@Stateless public class CalculatorBean {public float add. (int A, int b) {RETURN A B;} Enterprise Bean Class and Business Interface Enterprise JavaBeans 3.0, Early Draft

Exceptionssun Microsystems Inc.Public Float Subtract (Int A, INT B) {RETURN A - B;}} What is the name of the interface generated? It is definitely to be the rule. Determine the name of the interface according to the name of the Bean class.

?

转载请注明原文地址:https://www.9cbs.com/read-13581.html

New Post(0)