About Question enthuware.oce-jpad.v6.2.548 :
Moderator: admin
-
- Posts: 9
- Joined: Sat May 09, 2015 6:30 am
- Contact:
About Question enthuware.oce-jpad.v6.2.548 :
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.
-
- Site Admin
- Posts: 10046
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-jpad.v6.2.548 :
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.
HTH,
Paul.
If you like our products and services, please help us by posting your review here.
-
- Posts: 125
- Joined: Thu Jul 05, 2018 6:44 pm
- Contact:
Re: About Question enthuware.oce-jpad.v6.2.548 :
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:
Where does it say in the question that Address is not an entity?
Thanks.
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:
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: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.
Code: Select all
Address addr;
Thanks.
-
- Site Admin
- Posts: 10046
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-jpad.v6.2.548 :
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.
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.
-
- Posts: 125
- Joined: Thu Jul 05, 2018 6:44 pm
- Contact:
Re: About Question enthuware.oce-jpad.v6.2.548 :
OK I see, thank you.
Who is online
Users browsing this forum: No registered users and 57 guests