GeeCON Prague 2014*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes HFEJB  EJB relationship question 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 "HFEJB  EJB relationship question" Watch "HFEJB  EJB relationship question" New topic
Author

HFEJB EJB relationship question

Meg Adal
Ranch Hand

Joined: Mar 12, 2002
Posts: 70
HF EJB page 429 question 13.
Can somebody please explain the meaning of these statements:

A. Path expression (.) is considered the navigation operator.

B. Path expression can terminate with cmr-field or cmp-field

D.Path expression can end with single value or collection value.

==============================================================
HF EJB page 430 question 17.
Can somebody please explain the meaning of this statement:

A.The single_valued_path_expression must be a String value.

In the specs its mentioned


single_valued_path_expression ::={single_valued_navigation | identification_variable}.cmp_field |
single_valued_navigation


I am not clear about single_valued_path_expression, please somebody help :
Thanks in advance.

[ May 20, 2005: Message edited by: Meg Adal ]
[ May 20, 2005: Message edited by: Meg Adal ]
Prashant Neginahal
Ranch Hand

Joined: Sep 14, 2002
Posts: 77
Hi,

if path expresion is like this "o.orders", it implies multi-valued_path_ expression.Because Orders is a collection.

if path expression is like this "o.name", it implies single-valued_path_ expression.Because name is String(always carries one value).

Hope it helps.

Thanks,
Prashant


Thanks, <br />Prashant<br />SCJP, SCBCD
Meg Adal
Ranch Hand

Joined: Mar 12, 2002
Posts: 70
if path expression is like this "o.name", it implies single-valued_path_ expression.Because name is String(always carries one value).


But why it has to be String?
Can't I have expresion like "o.id" where id is "int" column is database?

Thanks in advance
Miki Muzsi
Ranch Hand

Joined: Jun 23, 2003
Posts: 120
I also do not get the real meaning of: single_valued_path_expression must be a String value. It can't be that the result must be a string since as Meg pointed out you can have o.intValue.


Miki<br /> <br />SCJP 1.4, SCBCD 1.3
Stefan Guilhen
Ranch Hand

Joined: Jul 31, 2004
Posts: 61
Hi all,

The question Meg posted (page 430 - Q17) refers to Like expressions. If you check the EJB2.0 specification, page 230 says the following:

"The syntax for the use of the comparison operator [NOT] LIKE in a conditional expression is as follows:

single_valued_path_expression [NOT] LIKE pattern-value [ESCAPE escape-character]

The single_valued_path_expression must have a String value."

Although the question is not very clear, its asking whether the single_valued_path_expression used in LIKE expressions should result in String or not. As we can see from the specification it should, so the spoted alternative is indeed correct.

Hope this helps,
Stefan


SCJP 1.4, SCBCD 1.3<br />IBM 141, 484, 486
Meg Adal
Ranch Hand

Joined: Mar 12, 2002
Posts: 70
Thanks for all replies.

The question Meg posted (page 430 - Q17) refers to Like expressions


Okay, it makes sense if the expression is "Like"
But the question 17 is : What's true about EJB QL,IN expressions?

and correct answers are A,B
So I think "A" should not be correct answer

Any thoughts??
Stefan Guilhen
Ranch Hand

Joined: Jul 31, 2004
Posts: 61
Hi again,

As I don't have the book anymore to check, I tried to remember what kind of expression was the question refering to and I thought it was about LIKE expressions. My bad. Now I know it refers to the IN expression. The question does not make it clear, but given the correct answers we see it was refering to the IN expression used in the WHERE clause. I say this because page 229 (botton) of the specification states the rules for IN expressions used in WHERE clauses:

"The syntax for the use of the comparison operator [NOT] IN in a conditional expression is as follows:
single_valued_path_expression [NOT] IN (string-literal [, string-literal]* )
The single_valued_path_expression must have a String value."

So again, it expects a String value.

Stefan
 
GeeCON Prague 2014
 
subject: HFEJB EJB relationship question