gpt4 book ai didi

java - 如何从 SFSB 的 SessionContext 获取业务对象

转载 作者:行者123 更新时间:2023-12-01 12:04:15 25 4
gpt4 key购买 nike

我不确定以下问题的正确答案是什么。

A developer writes a stateful session bean FooBean with two local business interfaces Foo and bar. The developer wants to write a business method called getBar for interface Foo that returns a Bar reference to the same session bean identity on which the client onvokes getBar. Which code, when inserted on line 12 below implements the getBar method with the wanted behavior?

10. @Resource SessionContext sessionCtx;
11. public Bar getbar () {
12. ?????
13. }

最佳答案

正确答案是getBusinessObject :

return sessionCtx.getBusinessObject(Bar.class)

关于java - 如何从 SFSB 的 SessionContext 获取业务对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27754519/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com