Page 1 of 1
About Question enthuware.oce-jpad.v6.2.591 :
Posted: Sun Feb 07, 2016 11:13 pm
by satyen
what is the hint from the question that 'ActivityDetails' is a singular Attribute
Re: About Question enthuware.oce-jpad.v6.2.591 :
Posted: Sun Feb 07, 2016 11:59 pm
by admin
The problem statement specifies that details field is of type ActivityDetail and not a collection of ActivityDetail. That means it is singular.
Re: About Question enthuware.oce-jpad.v6.2.591 :
Posted: Mon Aug 14, 2017 12:46 pm
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.
Re: About Question enthuware.oce-jpad.v6.2.591 :
Posted: Mon Aug 14, 2017 12:50 pm
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;
}