aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Chapter 7 - HF study group Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Chapter 7 - HF study group " Watch "Chapter 7 - HF study group " New topic
Author

Chapter 7 - HF study group

Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

For discussion of Head First EJB's Chapter 7.

Other Chapter discussions:
1 2 3 4 5 6 7


A good workman is known by his tools.
gayle craig
Ranch Hand

Joined: Oct 29, 2001
Posts: 35
P 397

"The two select methods ... doesn't say WHAT the methods will return... but we'll tell the container that one will return a Collection of Movies and one a Collection of Strings."

Where/how do we tell the container that? Does the container just know based on the EJB-QL that we write? Or from something else?
gayle craig
Ranch Hand

Joined: Oct 29, 2001
Posts: 35
p 407 Sharpen your pencil

[LEGAL] SELECT OBJECT (m) FROM MovieSchema m

[LEGAL] SELECT m.title FROM MovieSchema m

[NOT LEGAL] SELECT m FROM MovieSchema m

[NOT LEGAL] SELECT OBJECT (m.title) FROM MovieSchema m


Is that right?
gayle craig
Ranch Hand

Joined: Oct 29, 2001
Posts: 35
So how do we go about defining in the Deployment Descriptor something where Bean A has more than one relationship (i.e. Bean A has a relationship with Bean B and Bean C)? There will be more than one ejb-relationship-role definition for A I assume? And there will be more than one ejb-relation tag, also?


Let's say there's a 1 to many between A and B. And Many to Many between A and C.
A B
(1) ------ (*)

A C
(*) ------ (*)

I think it would be like this. Is this right?


[ March 20, 2005: Message edited by: gayle craig ]
Ganeshji Marwaha
Greenhorn

Joined: Sep 16, 2004
Posts: 27
Originally posted by gayle craig:
P 397

"The two select methods ... doesn't say WHAT the methods will return... but we'll tell the container that one will return a Collection of Movies and one a Collection of Strings."

Where/how do we tell the container that? Does the container just know based on the EJB-QL that we write? Or from something else?


Yes, we tell the container in the EJBQL...
Remember,
1. we use *OBJECT(M)* in the Select statement to return a component interface type.
2. we use *m.xxxx* in the select statement to return a particular data type(like a string).

Hope this answers your question.


-- Ganeshji Marwaha<br />SCJP<br />SCWCD<br />SCBCD<br />MCP, MCP+SB, MCSD
Ganeshji Marwaha
Greenhorn

Joined: Sep 16, 2004
Posts: 27
Originally posted by gayle craig:
So how do we go about defining in the Deployment Descriptor something where Bean A has more than one relationship (i.e. Bean A has a relationship with Bean B and Bean C)? There will be more than one ejb-relationship-role definition for A I assume? And there will be more than one ejb-relation tag, also? [ March 20, 2005: Message edited by: gayle craig ]


I didnt go through the full syntax of the code in the *relationships* tag. But the concept is right. that is exactly how u will be informing the container about the multiple relationships a bean has...
Gemini Moses
Ranch Hand

Joined: Jan 04, 2001
Posts: 245
Originally posted by gayle craig:
p 407 Sharpen your pencil

[LEGAL] SELECT OBJECT (m) FROM MovieSchema m

[LEGAL] SELECT m.title FROM MovieSchema m

[NOT LEGAL] SELECT m FROM MovieSchema m

[NOT LEGAL] SELECT OBJECT (m.title) FROM MovieSchema m


Is that right?


This is correct.

Gemini
[ March 22, 2005: Message edited by: Gemini Moses ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Chapter 7 - HF study group
 
Similar Threads
Chapter 4 - HF Sark study group
Chapter 3 - HF Sark study group
Chapter 5 - HF Sark study group
Chapter 2 - HF Sark study group
Chapter 1 - HF Sark study group