posted 16 years ago
Hi
Am having 3 entity classes Participant(participantId-ID),
Artifact(artifactId-ID) & Status(StatusIs-ID, readStatus).
There is a @ManyToMany relationship b/w Participant -> Artifact.
As a result in mysql DB a new join_table Participant_Artifact got created.
The structure of the Join table is
Participant_Artifact
Participant_participantId | Artifact_artifactId
My requirement is to add the read status per participantId/per ArtifactId.
i.e I need to create the ternary relationship b/w Participant_Artifact_Status. My Join Table should look like
Participant_Artifact_Status
Participant_participantId | Artifact_artifactId | Status_statusId
p1 a1 s1
p1 a2 s1
p2 a1 s2
p2 a2 s1
My Participant entity class looks like
@Entity
public class Participant implements Serializable {
@Id
private Long userId;
@ManyToMany
private List<Artifact> artifact ;
...
}
Artifact.java
@Entity
public class Artifact implements Serializable {
@Id
private Long artifactId;
...
}
Status.java
@Entity
public class Status implements Serializable {
@Id
private Long statusId
}
@ManyToMany b/w Participant -> Artifact
Could some one pl tell me How I can build ternary association b/w
Participant -> Artifact -> Status
[ December 23, 2008: Message edited by: Babu Mehrunnesa ]