mirror of
https://git.imnavajas.es/jjimenez/erp-imprimelibros.git
synced 2026-02-09 12:29:13 +00:00
añadido todo lo referente a paises
This commit is contained in:
82
src/main/java/com/imprimelibros/erp/paises/Paises.java
Normal file
82
src/main/java/com/imprimelibros/erp/paises/Paises.java
Normal file
@ -0,0 +1,82 @@
|
||||
package com.imprimelibros.erp.paises;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "paises")
|
||||
public class Paises {
|
||||
|
||||
@Id
|
||||
@Column(name = "keyword", length = 64, nullable = false)
|
||||
private String keyword;
|
||||
|
||||
@Column(name = "code", length = 2, nullable = false, unique = true)
|
||||
private String code;
|
||||
|
||||
@Column(name = "code3", length = 3, nullable = false, unique = true)
|
||||
private String code3;
|
||||
|
||||
@Column(name = "currency", length = 3, nullable = false)
|
||||
private String currency;
|
||||
|
||||
// --- Getters & Setters ---
|
||||
|
||||
public String getKeyword() {
|
||||
return keyword;
|
||||
}
|
||||
|
||||
public void setKeyword(String keyword) {
|
||||
this.keyword = keyword;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getCode3() {
|
||||
return code3;
|
||||
}
|
||||
|
||||
public void setCode3(String code3) {
|
||||
this.code3 = code3;
|
||||
}
|
||||
|
||||
public String getCurrency() {
|
||||
return currency;
|
||||
}
|
||||
|
||||
public void setCurrency(String currency) {
|
||||
this.currency = currency;
|
||||
}
|
||||
|
||||
// --- toString, equals & hashCode ---
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Paises{" +
|
||||
"keyword='" + keyword + '\'' +
|
||||
", code='" + code + '\'' +
|
||||
", code3='" + code3 + '\'' +
|
||||
", currency='" + currency + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return keyword != null ? keyword.hashCode() : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) return true;
|
||||
if (!(obj instanceof Paises other)) return false;
|
||||
return keyword != null && keyword.equals(other.keyword);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user