|
@ -5,36 +5,27 @@ import jakarta.persistence.*; |
|
|
import java.sql.Timestamp; |
|
|
import java.sql.Timestamp; |
|
|
|
|
|
|
|
|
@Entity |
|
|
@Entity |
|
|
@Table(name = "foro_principal", schema = "foro", catalog = "") |
|
|
|
|
|
public class ForoPrincipalEntity { |
|
|
|
|
|
|
|
|
@Table(name = "foro", schema = "foro", catalog = "") |
|
|
|
|
|
public class ForoEntity { |
|
|
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|
|
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|
|
@Id |
|
|
@Id |
|
|
@Column(name = "id", nullable = false) |
|
|
@Column(name = "id", nullable = false) |
|
|
private int id; |
|
|
private int id; |
|
|
@Basic |
|
|
@Basic |
|
|
@Column(name = "titulo", nullable = true, length = 45) |
|
|
|
|
|
|
|
|
@Column(name = "titulo", nullable = true, length = 150) |
|
|
private String titulo; |
|
|
private String titulo; |
|
|
@Basic |
|
|
@Basic |
|
|
@Column(name = "descripcion", nullable = true, length = 45) |
|
|
|
|
|
|
|
|
@Column(name = "descripcion", nullable = true, length = 150) |
|
|
private String descripcion; |
|
|
private String descripcion; |
|
|
@Basic |
|
|
@Basic |
|
|
@Column(name = "fechaYHora", nullable = true) |
|
|
@Column(name = "fechaYHora", nullable = true) |
|
|
private Timestamp fechaYHora; |
|
|
private Timestamp fechaYHora; |
|
|
@Basic |
|
|
@Basic |
|
|
@Column(name = "autors_id", nullable = false) |
|
|
|
|
|
private int autorsId; |
|
|
|
|
|
@Basic |
|
|
|
|
|
@Column(name = "imagen_id", nullable = false) |
|
|
@Column(name = "imagen_id", nullable = false) |
|
|
private int imagenId; |
|
|
private int imagenId; |
|
|
@Basic |
|
|
@Basic |
|
|
@Column(name = "users_id", nullable = false) |
|
|
|
|
|
private int usersId; |
|
|
|
|
|
@Basic |
|
|
|
|
|
@Column(name = "categoria_foro_id", nullable = false) |
|
|
@Column(name = "categoria_foro_id", nullable = false) |
|
|
private int categoriaForoId; |
|
|
private int categoriaForoId; |
|
|
@Basic |
|
|
|
|
|
@Column(name = "Respuestas_id", nullable = false) |
|
|
|
|
|
private int respuestasId; |
|
|
|
|
|
|
|
|
|
|
|
public int getId() { |
|
|
public int getId() { |
|
|
return id; |
|
|
return id; |
|
@ -68,14 +59,6 @@ public class ForoPrincipalEntity { |
|
|
this.fechaYHora = fechaYHora; |
|
|
this.fechaYHora = fechaYHora; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public int getAutorsId() { |
|
|
|
|
|
return autorsId; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setAutorsId(int autorsId) { |
|
|
|
|
|
this.autorsId = autorsId; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public int getImagenId() { |
|
|
public int getImagenId() { |
|
|
return imagenId; |
|
|
return imagenId; |
|
|
} |
|
|
} |
|
@ -84,14 +67,6 @@ public class ForoPrincipalEntity { |
|
|
this.imagenId = imagenId; |
|
|
this.imagenId = imagenId; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public int getUsersId() { |
|
|
|
|
|
return usersId; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setUsersId(int usersId) { |
|
|
|
|
|
this.usersId = usersId; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public int getCategoriaForoId() { |
|
|
public int getCategoriaForoId() { |
|
|
return categoriaForoId; |
|
|
return categoriaForoId; |
|
|
} |
|
|
} |
|
@ -100,27 +75,16 @@ public class ForoPrincipalEntity { |
|
|
this.categoriaForoId = categoriaForoId; |
|
|
this.categoriaForoId = categoriaForoId; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public int getRespuestasId() { |
|
|
|
|
|
return respuestasId; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setRespuestasId(int respuestasId) { |
|
|
|
|
|
this.respuestasId = respuestasId; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public boolean equals(Object o) { |
|
|
public boolean equals(Object o) { |
|
|
if (this == o) return true; |
|
|
if (this == o) return true; |
|
|
if (o == null || getClass() != o.getClass()) return false; |
|
|
if (o == null || getClass() != o.getClass()) return false; |
|
|
|
|
|
|
|
|
ForoPrincipalEntity that = (ForoPrincipalEntity) o; |
|
|
|
|
|
|
|
|
ForoEntity that = (ForoEntity) o; |
|
|
|
|
|
|
|
|
if (id != that.id) return false; |
|
|
if (id != that.id) return false; |
|
|
if (autorsId != that.autorsId) return false; |
|
|
|
|
|
if (imagenId != that.imagenId) return false; |
|
|
if (imagenId != that.imagenId) return false; |
|
|
if (usersId != that.usersId) return false; |
|
|
|
|
|
if (categoriaForoId != that.categoriaForoId) return false; |
|
|
if (categoriaForoId != that.categoriaForoId) return false; |
|
|
if (respuestasId != that.respuestasId) return false; |
|
|
|
|
|
if (titulo != null ? !titulo.equals(that.titulo) : that.titulo != null) return false; |
|
|
if (titulo != null ? !titulo.equals(that.titulo) : that.titulo != null) return false; |
|
|
if (descripcion != null ? !descripcion.equals(that.descripcion) : that.descripcion != null) return false; |
|
|
if (descripcion != null ? !descripcion.equals(that.descripcion) : that.descripcion != null) return false; |
|
|
if (fechaYHora != null ? !fechaYHora.equals(that.fechaYHora) : that.fechaYHora != null) return false; |
|
|
if (fechaYHora != null ? !fechaYHora.equals(that.fechaYHora) : that.fechaYHora != null) return false; |
|
@ -134,11 +98,8 @@ public class ForoPrincipalEntity { |
|
|
result = 31 * result + (titulo != null ? titulo.hashCode() : 0); |
|
|
result = 31 * result + (titulo != null ? titulo.hashCode() : 0); |
|
|
result = 31 * result + (descripcion != null ? descripcion.hashCode() : 0); |
|
|
result = 31 * result + (descripcion != null ? descripcion.hashCode() : 0); |
|
|
result = 31 * result + (fechaYHora != null ? fechaYHora.hashCode() : 0); |
|
|
result = 31 * result + (fechaYHora != null ? fechaYHora.hashCode() : 0); |
|
|
result = 31 * result + autorsId; |
|
|
|
|
|
result = 31 * result + imagenId; |
|
|
result = 31 * result + imagenId; |
|
|
result = 31 * result + usersId; |
|
|
|
|
|
result = 31 * result + categoriaForoId; |
|
|
result = 31 * result + categoriaForoId; |
|
|
result = 31 * result + respuestasId; |
|
|
|
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |