开发者

In EJB3, How to implement inheritance for Session Bean?

We want to achieve following things:

  1. Create Abstract Stateless session bean
  2. Create stateless bean by extending the above bean.
  3. In Service class, base开发者_高级运维d on type container will inject appropriate ejb bean


Here is what I suggest:

  1. Create an Abstract Stateless session bean.
  2. Create Stateless Session Beans by extending the above bean.
  3. In Service class, inject appropriate EJB bean based on type.

If you face a specific problem, ask a more specific question.


I guess that you've not read the EJB 3 specification yet. In the spec document in section 4.9.2 you'll find that the ejb can't be final or abstract. So the way that you are trying to implement the inheritance isn't possible. I hope this is helpful. Regards

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜