package com;
/**
*
* @author sunny
*/
import javax.ejb.Local;
public interface BookService {
@Local //error here (annotation type not applicable to this kind of declaration)
Book createOrUpdate(Book book);
void remove(Book book);
Book find(Object id);
}
答案 0 :(得分:1)
编写本地界面,如下所示:
package com;
public interface BookServiceLocal {
Book createOrUpdate(Book book);
void remove(Book book);
Book find(Object id);
}
然后通过注释将本地接口添加到EJB类:
package com;
import javax.ejb.Local;
@Stateless //Or any other type of EJB you want
@Local (BookServiceLocal.class)
public BookService {
Book createOrUpdate(Book book){return null;}
void remove(Book book){}
Book find(Object id){return null;}
}