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.Collection;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
import static dst.ass1.jpa.util.Constants.*;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
public class Trip implements ITrip {
|
public class Trip implements ITrip {
|
||||||
@Id @GeneratedValue private Long id;
|
@Id @GeneratedValue private Long id;
|
||||||
@ -15,8 +17,14 @@ public class Trip implements ITrip {
|
|||||||
private ILocation pickup;
|
private ILocation pickup;
|
||||||
private ILocation destination;
|
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 Collection<ILocation> stops;
|
||||||
|
|
||||||
private ITripInfo tripInfo;
|
private ITripInfo tripInfo;
|
||||||
private IMatch match;
|
private IMatch match;
|
||||||
private IRider rider;
|
private IRider rider;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user