Skip to content
Snippets Groups Projects
Verified Commit 365ad9bb authored by Adam Krídl's avatar Adam Krídl
Browse files

Add Country entity

parent a7a915b6
No related branches found
No related tags found
No related merge requests found
package cz.muni.fi.pa165.core.data.domain;
import cz.muni.fi.pa165.core.data.domain.common.DomainEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import java.util.Objects;
@Entity
@Table(name = "countries")
@Data
@NoArgsConstructor
public class Country extends DomainEntity {
@Column(nullable = false, unique = true)
private @NonNull String name;
// TODO: Add relationship Country - City
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof Country country)) {
return false;
}
return getName().equals(country.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