add basic models for user and trip schema

This commit is contained in:
2025-12-02 16:11:31 +01:00
parent cf1819dd1f
commit 6f7185236c
8 changed files with 328 additions and 39 deletions
@@ -12,9 +12,11 @@ public class TripSegment {
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false)
private Long TripId;
@ManyToOne
@JoinColumn(name = "trip_id", nullable = false)
private Trip trip;
@Enumerated(EnumType.STRING)
@Column(nullable = false)
private Modality modality;
@@ -27,5 +29,53 @@ public class TripSegment {
@Column(nullable = false)
private Long distance;
public TripSegment() {}
public TripSegment(Long id, Trip trip, Modality modality, LocalDateTime startTime, Long distance) {
this.id = id;
this.trip = trip;
this.modality = modality;
this.startTime = startTime;
this.distance = distance;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Trip getTrip() {
return trip;
}
public void setTrip(Trip trip) {
this.trip = trip;
}
public Modality getModality() {
return modality;
}
public void setModality(Modality modality) {
this.modality = modality;
}
public LocalDateTime getStartTime() {
return startTime;
}
public void setStartTime(LocalDateTime startTime) {
this.startTime = startTime;
}
public Long getDistance() {
return distance;
}
public void setDistance(Long distance) {
this.distance = distance;
}
}