Skip to content

Instantly share code, notes, and snippets.

@OleksandrDanylchenko
Created February 9, 2020 15:03
Show Gist options
  • Save OleksandrDanylchenko/cd890808b81727cb90954924a7147788 to your computer and use it in GitHub Desktop.
Save OleksandrDanylchenko/cd890808b81727cb90954924a7147788 to your computer and use it in GitHub Desktop.
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