Add Vehicle model
This commit is contained in:
parent
691c01aa98
commit
9bfddd2854
65
ass1-jpa/src/main/java/dst/ass1/jpa/model/impl/Vehicle.java
Normal file
65
ass1-jpa/src/main/java/dst/ass1/jpa/model/impl/Vehicle.java
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
package dst.ass1.jpa.model.impl;
|
||||||
|
|
||||||
|
import dst.ass1.jpa.model.IDriver;
|
||||||
|
import dst.ass1.jpa.model.IMatch;
|
||||||
|
import dst.ass1.jpa.model.IOrganization;
|
||||||
|
import dst.ass1.jpa.model.IVehicle;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
public class Vehicle implements IVehicle {
|
||||||
|
@Id
|
||||||
|
private Long id;
|
||||||
|
@Column(unique = true)
|
||||||
|
private String license;
|
||||||
|
private String color;
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@OneToMany
|
||||||
|
private IDriver driver;
|
||||||
|
@OneToMany
|
||||||
|
private IMatch match;
|
||||||
|
@ManyToMany
|
||||||
|
private IOrganization organization;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLicense() {
|
||||||
|
return license;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setLicense(String license) {
|
||||||
|
this.license = license;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getColor() {
|
||||||
|
return color;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setColor(String color) {
|
||||||
|
this.color = color;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setType(String type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user