Page 1 of 1

About Question enthuware.oce-jpad.v6.2.548 :

Posted: Wed Jul 29, 2015 11:22 am
by piotr.kraciuk
This question would be more clear, if the Address class was presented. Right now it is not clear, whether it is Serializable or not, and whether it already has some annotations.

Re: About Question enthuware.oce-jpad.v6.2.548 :

Posted: Thu Jul 30, 2015 11:26 pm
by admin
As a general rule, any information that is not present should be assumed to not affect the answer. In this case, both the things that you mentioned (Serializable and annotations) are being asked in the options. So you can safely assume that any information not already given is not relevant for the question.

HTH,
Paul.

Re: About Question enthuware.oce-jpad.v6.2.548 :

Posted: Sat Sep 22, 2018 9:51 pm
by __JJ__
I do not understand why annotating the Address class with @Entity is not a correct answer.
If I code this as it is, with an Address field but Address existing as just a class, neither annotated with @Entity or @Embeddable, it will presumably not work.
I can either annotate Address with @Entity, or with @Embeddable (and annotate the addr field with @Embedded).
So, why, and in what way, is the first way incorrect, because this is what I have been doing for weeks when coding my test programs.

By the way, the explanation given:
Address is not an entity in its own right. It is just a collection of fields of Employee class. Such type of classes are called embedded classes.
is curious because how are we supposed to know that from what is stated in the question? We simply have a field of type X. We are not told anything more than that. All we get is this:

Code: Select all

Address addr;
Where does it say in the question that Address is not an entity?

Thanks.

Re: About Question enthuware.oce-jpad.v6.2.548 :

Posted: Sat Sep 22, 2018 10:02 pm
by admin
Technically, you can model Address as an entity but it is not a must. Option 2 says, "Address must be annotated with @Entity." That is certainly not true.

I think the decision to make Address a full fledged entity or not is a bit subjective. If you are developing an application that is about managing addresses, then probably you may make it an entity. Otherwise, an embeddable is fine.

Re: About Question enthuware.oce-jpad.v6.2.548 :

Posted: Sun Sep 23, 2018 1:30 pm
by __JJ__
OK I see, thank you.