Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Rubén Ramírez
/
MangAffinity
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
35ace176
authored
May 05, 2025
by
Rubén Ramírez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
feat: [Usuario]:Nuevos atributos para almacenar los seguidores y seguidos
parent
d37843f8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
src/main/java/com/ujaen/tfg/mangaffinity/entidades/Usuario.java
src/main/java/com/ujaen/tfg/mangaffinity/entidades/Usuario.java
View file @
35ace176
...
...
@@ -5,6 +5,9 @@ import lombok.*;
import
jakarta.validation.constraints.Email
;
import
jakarta.validation.constraints.NotBlank
;
import
java.util.HashSet
;
import
java.util.Set
;
@Entity
@Table
(
name
=
"usuarios"
)
@Getter
...
...
@@ -46,6 +49,12 @@ public class Usuario {
@OneToOne
(
mappedBy
=
"usuario"
,
cascade
=
CascadeType
.
ALL
,
fetch
=
FetchType
.
LAZY
)
private
BibliotecaPersonal
bibliotecaPersonal
;
@OneToMany
(
mappedBy
=
"seguidor"
,
cascade
=
CascadeType
.
ALL
,
orphanRemoval
=
true
)
private
Set
<
Seguimiento
>
seguidos
=
new
HashSet
<>();
@OneToMany
(
mappedBy
=
"seguido"
,
cascade
=
CascadeType
.
ALL
,
orphanRemoval
=
true
)
private
Set
<
Seguimiento
>
seguidores
=
new
HashSet
<>();
public
Usuario
(
String
email
,
String
nombreUsuario
,
String
contrasenia
)
{
this
.
email
=
email
;
this
.
nombreUsuario
=
nombreUsuario
;
...
...
@@ -53,5 +62,8 @@ public class Usuario {
this
.
rol
=
"USUARIO_REGISTRADO"
;
this
.
bibliotecaPersonal
=
new
BibliotecaPersonal
(
this
);
this
.
descripcion
=
""
;
this
.
fotoPerfil
=
null
;
this
.
seguidos
=
new
HashSet
<>();
this
.
seguidores
=
new
HashSet
<>();
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment