This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes (HF EJB) abstract-schema-type == local component interface type? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "(HF EJB) abstract-schema-type == local component interface type? " Watch "(HF EJB) abstract-schema-type == local component interface type? " New topic
Author

(HF EJB) abstract-schema-type == local component interface type?

Ming Hu
Greenhorn

Joined: Mar 01, 2004
Posts: 25
In P420, second bullet point from the bottom on the right side. It reads,
"A SELECT can return either an <abstract-schema-type> (which really means the bean's local component interface type), or a single-value field".
Is this correct? Thanks.
Reid M. Pinchback
Ranch Hand

Joined: Jan 25, 2002
Posts: 775
That word 'local' shouldn't be there - the deployment descriptor determines if the component interface is to be local or remote.


Reid - SCJP2 (April 2002)
Ming Hu
Greenhorn

Joined: Mar 01, 2004
Posts: 25
Originally posted by Reid M. Pinchback:
the deployment descriptor determines if the component interface is to be local or remote.

Thanks Reid for your input. I have a follow up question: Can DD do that? What if you define both remote and local interfaces for a bean?
Reid M. Pinchback
Ranch Hand

Joined: Jan 25, 2002
Posts: 775
It goes in the deployment descriptor; one of those values that the bean provider generally specifies.
Any given ejbSelect that returns object references must support either remote objects, or local objects, but not both ('both' isn't a value you can put in that field in the DD).
There isn't anything stopping you from having two virtually-identical EJB-QL select specifications in the DD; one for remote, one for local, but you would have to give them different names (and hence you'd have difference abstract ejbSelect<METHOD> declarations for each in your bean class).
Note that this remote-or-local-not-both limitation doesn't apply to the find methods. Finders will automatically provide remote object references when you are using a remote home interface, and local object references when you are using a local home interface.
Ming Hu
Greenhorn

Joined: Mar 01, 2004
Posts: 25
It goes in the deployment descriptor; one of those values that the bean provider generally specifies.
Any given ejbSelect that returns object references must support either remote objects, or local objects, but not both ('both' isn't a value you can put in that field in the DD).

You are right. There is a "result-type-mapping" tag. Although it is optional, the default is local. I was misled by the following (HF EJB P408): "As if by magic, the container knows which interface view to return, local or remote, depending on whether the invocation of the query came from a home or remote interface" or wasn't I?

Note that this remote-or-local-not-both limitation doesn't apply to the find methods. Finders will automatically provide remote object references when you are using a remote home interface, and local object references when you are using a local home interface.

How do you differentiate a select from a find in the deployment descriptor. Aren't they both declared in "query" tag?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: (HF EJB) abstract-schema-type == local component interface type?