| | |
| | | package de.gedoplan.seminar.jpa.exercise.domain; |
| | | |
| | | public class Highway { |
| | | import javax.persistence.Entity; |
| | | import javax.persistence.Id; |
| | | import javax.persistence.Table; |
| | | |
| | | @Entity |
| | | @Table(name = Highway.TABLE_NAME) |
| | | public class Highway { |
| | | |
| | | public static final String TABLE_NAME = "JPA_HIGHWAY"; |
| | | |
| | | @Id |
| | | private int id; |
| | | private String name; |
| | | private String origin; |
| | | private String destination; |
| | | |
| | | public Highway() { |
| | | } |
| | | |
| | | public Highway(int id, String name, String origin, String destination) { |
| | | this.id = id; |
| | |
| | | return this.destination; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "Highway [id=" + id + ", name=" + name + ", origin=" + origin + ", destination=" + destination + "]"; |
| | | } |
| | | |
| | | } |