Skip to content
Snippets Groups Projects
Commit 2eb439fc authored by Martin Slovík's avatar Martin Slovík
Browse files

Adding AirplaneType model

parent f8dce425
No related branches found
No related tags found
No related merge requests found
package cz.muni.fi.pa165.core.data.domain;
import jakarta.persistence.*;
import java.io.Serializable;
import java.util.Objects;
@Entity(name = "airplane_type")
public class AirplaneType implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false, unique = true)
private String name;
public AirplaneType() {
}
public AirplaneType(String name) {
this.name = name;
}
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof AirplaneType airplaneType)) {
return false;
}
return Objects.equals(getName(), airplaneType.getName());
}
@Override
public int hashCode() {
return Objects.hash(getName());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment