Created
February 9, 2020 15:03
-
-
Save OleksandrDanylchenko/cd890808b81727cb90954924a7147788 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ua.alexd.domain; | |
import javax.persistence.*; | |
import java.util.Objects; | |
@Entity | |
@Table(name = "Shops") | |
public class Shops { | |
@Id | |
@GeneratedValue(strategy = GenerationType.AUTO) | |
@Column(name = "Id") | |
private int id; | |
@Basic | |
@Column(name = "Address") | |
private String address; | |
public int getId() { | |
return id; | |
} | |
public void setId(int id) { | |
this.id = id; | |
} | |
public String getAddress() { | |
return address; | |
} | |
public void setAddress(String address) { | |
this.address = address; | |
} | |
@Override | |
public boolean equals(Object o) { | |
if (this == o) return true; | |
if (o == null || getClass() != o.getClass()) return false; | |
Shops shops = (Shops) o; | |
return id == shops.id && | |
Objects.equals(address, shops.address); | |
} | |
@Override | |
public int hashCode() { | |
return Objects.hash(id, address); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment