| 1 | package com.tecmilenio.mapsconect.entity; |
| 2 | |
| 3 | import jakarta.persistence.*; |
| 4 | import lombok.AllArgsConstructor; |
| 5 | import lombok.Builder; |
| 6 | import lombok.Data; |
| 7 | import lombok.NoArgsConstructor; |
| 8 | |
| 9 | @Entity |
| 10 | @Table(name = "estudiantes") |
| 11 | @Data |
| 12 | @NoArgsConstructor |
| 13 | @AllArgsConstructor |
| 14 | @Builder |
| 15 | public class Estudiante { |
| 16 | |
| 17 | @Id |
| 18 | @GeneratedValue(strategy = GenerationType.IDENTITY) |
| 19 | @Column(name = "id_estudiante") |
| 20 | private Integer id; |
| 21 | |
| 22 | @OneToOne |
| 23 | @JoinColumn(name = "id_usuario", nullable = false, unique = true) |
| 24 | private Usuario usuario; |
| 25 | |
| 26 | @Column(name = "id_carrera") |
| 27 | private Integer idCarrera; |
| 28 | |
| 29 | @Column(nullable = false, length = 20) |
| 30 | private String matricula; |
| 31 | |
| 32 | @Column(name = "semestre_actual", nullable = false) |
| 33 | private Integer semestreActual; |
| 34 | |
| 35 | @Column(name = "proposito_vida", columnDefinition = "TEXT") |
| 36 | private String propositoVida; |
| 37 | |
| 38 | @Builder.Default |
| 39 | @Column(name = "puntos_reputacion", nullable = false) |
| 40 | private Integer puntosReputacion = 0; |
| 41 | |
| 42 | } |