Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.persistence.*;
- import java.util.ArrayList;
- import java.util.List;
- import java.util.Objects;
- @Entity(name = "Subsidiary")
- @Table(name = "SUCURSAL")
- public class Subsidiary {
- @Id
- @SequenceGenerator(name = "SEQ_SUBSIDIARY", sequenceName = "SUCURSAL_SEQ", allocationSize = 1)
- @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_SUBSIDIARY")
- @Column(name = "NUMCODIGOSUCURSAL")
- private int subsidiaryId;
- @Column(name = "VCHDESCRIPCION")
- private String description;
- @Column(name = "NUMTELEFONO")
- private String phone;
- @Column(name = "NUMSERIE")
- private Integer serie;
- @Column(name = "CHRESTADO")
- private Character state;
- @Column(name = "VCHDIRECCION")
- private String address;
- @Column(name = "CHRCODIGOUBIGEO")
- private String ubigeo;
- @Column(name = "NUMCODIGONIVEL")
- private Integer levelCode;
- @Column(name = "VCHTELEFONO")
- private String phone2;
- @OneToMany(
- mappedBy = "subsidiary",
- cascade = CascadeType.ALL,
- orphanRemoval = true
- )
- private List<SubsidiaryUser> users = new ArrayList<>();
- public String getDescription() {
- return description;
- }
- public void setDescription(String description) {
- this.description = description;
- }
- public String getPhone() {
- return phone;
- }
- public void setPhone(String phone) {
- this.phone = phone;
- }
- public Integer getSerie() {
- return serie;
- }
- public void setSerie(Integer serie) {
- this.serie = serie;
- }
- public int getSubsidiaryId() {
- return subsidiaryId;
- }
- public void setSubsidiaryId(int subsidiaryId) {
- this.subsidiaryId = subsidiaryId;
- }
- public Character getState() {
- return state;
- }
- public void setState(Character state) {
- this.state = state;
- }
- public String getAddress() {
- return address;
- }
- public void setAddress(String address) {
- this.address = address;
- }
- public String getUbigeo() {
- return ubigeo;
- }
- public void setUbigeo(String ubigeo) {
- this.ubigeo = ubigeo;
- }
- public Integer getLevelCode() {
- return levelCode;
- }
- public void setLevelCode(Integer levelCode) {
- this.levelCode = levelCode;
- }
- public String getPhone2() {
- return phone2;
- }
- public void setPhone2(String phone2) {
- this.phone2 = phone2;
- }
- public List<SubsidiaryUser> getUsers() {
- return users;
- }
- public void setUsers(List<SubsidiaryUser> users) {
- this.users = users;
- }
- public Subsidiary() {
- }
- public Subsidiary(String description, String phone, Integer serie, Character state, String address, String ubigeo, Integer levelCode, String phone2) {
- this.description = description;
- this.phone = phone;
- this.serie = serie;
- this.state = state;
- this.address = address;
- this.ubigeo = ubigeo;
- this.levelCode = levelCode;
- this.phone2 = phone2;
- }
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- Subsidiary that = (Subsidiary) o;
- return Objects.equals(description, that.description) &&
- Objects.equals(phone, that.phone) &&
- Objects.equals(serie, that.serie) &&
- Objects.equals(state, that.state) &&
- Objects.equals(address, that.address) &&
- Objects.equals(ubigeo, that.ubigeo) &&
- Objects.equals(levelCode, that.levelCode) &&
- Objects.equals(phone2, that.phone2);
- }
- @Override
- public int hashCode() {
- return Objects.hash(description, phone, serie, state, address, ubigeo, levelCode, phone2);
- }
Add Comment
Please, Sign In to add comment