| | |
| | | package de.gedoplan.seminar.jpa.exercise.domain; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import javax.persistence.Entity; |
| | | import javax.persistence.Id; |
| | | import javax.persistence.OneToMany; |
| | | import javax.persistence.Table; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
| | | |
| | | @Entity |
| | | @Table(name = Highway.TABLE_NAME) |
| | |
| | | private String name; |
| | | private String origin; |
| | | private String destination; |
| | | |
| | | @JsonIgnoreProperties("highway") |
| | | @OneToMany(mappedBy = "highway") |
| | | private List<Junction> junctions = new ArrayList<>(); |
| | | |
| | | public Highway() { |
| | | } |
| | |
| | | public String getDestination() { |
| | | return this.destination; |
| | | } |
| | | |
| | | |
| | | public List<Junction> getJunctions() { |
| | | return junctions; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |