Model ManyToMany Trip <-> Location
This commit is contained in:
parent
200eb6efd4
commit
00d2078a30
@ -6,6 +6,8 @@ import javax.persistence.*;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
|
||||
import static dst.ass1.jpa.util.Constants.*;
|
||||
|
||||
@Entity
|
||||
public class Trip implements ITrip {
|
||||
@Id @GeneratedValue private Long id;
|
||||
@ -15,8 +17,14 @@ public class Trip implements ITrip {
|
||||
private ILocation pickup;
|
||||
private ILocation destination;
|
||||
|
||||
@ManyToMany
|
||||
@ManyToMany(targetEntity = Location.class)
|
||||
@JoinTable(
|
||||
name = J_TRIP_LOCATION,
|
||||
joinColumns = @JoinColumn(name = I_TRIP),
|
||||
inverseJoinColumns = @JoinColumn(name = I_LOCATION)
|
||||
)
|
||||
private Collection<ILocation> stops;
|
||||
|
||||
private ITripInfo tripInfo;
|
||||
private IMatch match;
|
||||
private IRider rider;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user