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

Moderator: admin

Post Reply
satyen
Posts: 4
Joined: Tue Oct 15, 2013 11:12 am
Contact:

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

Post by satyen »

what is the hint from the question that 'ActivityDetails' is a singular Attribute

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

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

Post by admin »

The problem statement specifies that details field is of type ActivityDetail and not a collection of ActivityDetail. That means it is singular.
If you like our products and services, please help us by posting your review here.

himaiMinh
Posts: 358
Joined: Fri Nov 29, 2013 8:26 pm
Contact:

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

Post by himaiMinh »

But Activity class is an entity according to the question statement "Activity class contains two persistence fields..."
I think it should be

Code: Select all

@OneToMany
Set<Activity> recentActivities
If we use @ElementCollection, Activity should be an embeddable class.
Correct me if I am wrong.

himaiMinh
Posts: 358
Joined: Fri Nov 29, 2013 8:26 pm
Contact:

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

Post by himaiMinh »

Let me answer my own question.
I guess Activity may be an embeddable, not an entity:

Code: Select all

@Embeddable
public class Activity{
//This relationship is for Customer to ActivityDetail;
@ManyToOne
ActivityDetail details;

//An embedable class inside Activity.
@Embedded
Note note;


}

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests