Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

From section 4.6.6 of EJB 3.0 Core Specification:  RSS feed

 
Amandeep Singh
Ranch Hand
Posts: 850
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While it is expected that the bean class will typically implement its business interface(s), if the bean class uses annotations or the deployment descriptor to designate its business interface(s), it is not required that the bean class also be specified as implementing the interface(s).


does this mean if in bean class,
we are exposing the buisness interface using the @Local annotation. Then there is no need for MyBean to implement the MyBeanInterface.

@Stateless
public class MyBean{
@Local(MyBeanInterface.class)
}
 
prashant k. gupta
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Amandeep Singh:


does this mean if in bean class,
we are exposing the buisness interface using the @Local annotation. Then there is no need for MyBean to implement the MyBeanInterface.

@Stateless
public class MyBean{
@Local(MyBeanInterface.class)
}


Yes you are right, bean need not to implement business interface in case we are using @Local annotation. But I think we need to define at class level.

@Local(MyBeanInterface.class)
@Stateless
public class MyBean{

}
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!