热门面试题与答案和在线测试
面向面试准备、在线测试、教程与实战练习的学习平台

通过聚焦学习路径、模拟测试和面试实战内容持续提升技能。

WithoutBook 将分主题面试题、在线练习测试、教程和对比指南整合到一个响应式学习空间中。

面试准备

模拟考试

设为首页

收藏此页面

订阅邮箱地址

EJB 面试题与答案

Test your skills through the online practice test: EJB Quiz Online Practice Test

相关差异对比

相关差异对比

EJB 2.0 vs EJB 3.0EJB 3.0 vs SpringEJB 1.0 vs EJB 2.0
JavaBeans vs EJB

问题 11. What is lazy loading?

Lazy loading means not creating an object until the first time it is accessed. Lazy loading typically looks like this:

public class Example {
private Vector data = null;
public Vector getData() {
if (this.data == null) {
this.data = new Vector();
// Load data into vector
}
return this.data;
}
}

This technique is most useful when you have large hierarchies of objects (such as a product catalog). You can lazy-load subordinate objects as you navigate down the hierarchy, and thereby only create objects when you need them.

这有帮助吗? 添加评论 查看评论
 

问题 12. Can I map more than one table in a CMP?

No, you cannot map more than one table to a single CMP Entity Bean. CMP has been, in fact, designed to map a single table.

这有帮助吗? 添加评论 查看评论
 

问题 13. Is Decorator an EJB design pattern?

No. Decorator design pattern, is the one which exhibits very low level runtime polymorphism, for the specific and single object (Instance of the class), but not for atleast for a class. It is the stuff to add specific functionality to a single & pointed object and leaves others like it unmodified. It is having close similarities like aspectJ stuff, but not with EJB stuff.

这有帮助吗? 添加评论 查看评论
 

问题 14. What is the difference between sessioncontext and entitycontext?

Since EnterpriseBeans live in a managed container, the container is free to call your EJB components methods at its leisure. The container houses the information like current status of bean,security credentials of the user currently accessing the bean in one object is called EJBContext Object. A context represents a way for beans to perform callbacks and modify their current status Sessioncontext is EJB context for session bean Entitycontext is EJB context for entity bean Message driven context is EJB context for message driven bean.

这有帮助吗? 添加评论 查看评论
 

问题 15. Does stateless Session bean create() method contain any parameters?

Stateless SessionBean create() method doesnot contain any parameters and the syntax is as follows:
public interface XSessionEJBHome extends EJBHome
{
XSessionEJB create() throws RemoteException, CreateException;
}

这有帮助吗? 添加评论 查看评论
 

用户评价最有帮助的内容:

版权所有 © 2026,WithoutBook。