Commit 1d28629b by Rubén Ramírez

feat: [Genero]: Creada la clase Genero con los atributos básicos

parent 5c30f7e4
package com.ujaen.tfg.mangaffinity.entidades;
import jakarta.persistence.*;
import lombok.*;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Positive;
@Entity
@Table(name = "capitulos")
@Getter
@NoArgsConstructor
public class Capitulo {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Positive
@Column(nullable = false)
private int numero;
@NotBlank
@Column(nullable = false)
private String titulo;
@NotBlank
@Column(nullable = false, unique = true)
private String url;
@NotBlank
@Column(nullable = false)
private String fuente;
// Constructor con parámetros
public Capitulo(int numero, String titulo, String url, String fuente) {
this.numero = numero;
this.titulo = titulo;
this.url = url;
this.fuente = fuente;
}
}
package com.ujaen.tfg.mangaffinity.entidades;
import jakarta.persistence.*;
import lombok.*;
import jakarta.validation.constraints.NotBlank;
@Entity
@Table(name = "generos")
@Getter
@NoArgsConstructor
public class Genero {
@Id
@NotBlank
@Column(nullable = false, unique = true)
private String nombre;
public Genero(String nombre) {
this.nombre = nombre;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment