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

Moderator: admin

Post Reply
piotr.kraciuk
Posts: 9
Joined: Sat May 09, 2015 6:30 am
Contact:

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

Post by piotr.kraciuk » Wed Jul 29, 2015 11:22 am

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.

admin
Site Admin
Posts: 7551
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin » Thu Jul 30, 2015 11:26 pm

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.
If you like our products and services, please help us by posting your review here.

__JJ__
Posts: 125
Joined: Thu Jul 05, 2018 6:44 pm
Contact:

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

Post by __JJ__ » Sat Sep 22, 2018 9:51 pm

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.

admin
Site Admin
Posts: 7551
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin » Sat Sep 22, 2018 10:02 pm

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.
If you like our products and services, please help us by posting your review here.

__JJ__
Posts: 125
Joined: Thu Jul 05, 2018 6:44 pm
Contact:

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

Post by __JJ__ » Sun Sep 23, 2018 1:30 pm

OK I see, thank you.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests