Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PA165 - Airport - project
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ján Macháček
PA165 - Airport - project
Commits
365ad9bb
There was an error fetching the commit references. Please try again later.
Verified
Commit
365ad9bb
authored
1 year ago
by
Adam Krídl
Browse files
Options
Downloads
Patches
Plain Diff
Add Country entity
parent
a7a915b6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/src/main/java/cz/muni/fi/pa165/core/data/domain/Country.java
+39
-0
39 additions, 0 deletions
.../main/java/cz/muni/fi/pa165/core/data/domain/Country.java
with
39 additions
and
0 deletions
core/src/main/java/cz/muni/fi/pa165/core/data/domain/Country.java
0 → 100644
+
39
−
0
View file @
365ad9bb
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
());
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment