Add Location model
This commit is contained in:
parent
9bfddd2854
commit
ec7887f0d0
49
ass1-jpa/src/main/java/dst/ass1/jpa/model/impl/Location.java
Normal file
49
ass1-jpa/src/main/java/dst/ass1/jpa/model/impl/Location.java
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
package dst.ass1.jpa.model.impl;
|
||||||
|
|
||||||
|
import dst.ass1.jpa.model.ILocation;
|
||||||
|
import dst.ass1.jpa.model.ITrip;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.ManyToMany;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
public class Location implements ILocation {
|
||||||
|
@Id
|
||||||
|
private Long id;
|
||||||
|
private String name;
|
||||||
|
private Long locationId;
|
||||||
|
|
||||||
|
@ManyToMany
|
||||||
|
private ITrip trip;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long getLocationId() {
|
||||||
|
return locationId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setLocationId(Long locationId) {
|
||||||
|
this.locationId = locationId;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user