Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Alba María Álvarez
/
AppRecetas
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
f3a3de77
authored
Jun 17, 2025
by
Alba María Álvarez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
perf(UserDocument): añadida restricción de valor único a email y username
parent
65d66cfd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
10 deletions
src/main/java/com/example/apprecetas/user/infrastructure/repository/mongodb/UserDocument.java
src/main/java/com/example/apprecetas/user/infrastructure/repository/mongodb/UserDocument.java
View file @
f3a3de77
package
com
.
example
.
apprecetas
.
user
.
infrastructure
.
repository
.
mongodb
;
package
com
.
example
.
apprecetas
.
user
.
infrastructure
.
repository
.
mongodb
;
import
jakarta.persistence.*
;
import
lombok.Getter
;
import
lombok.Getter
;
import
lombok.Setter
;
import
lombok.Setter
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.data.mongodb.core.index.Indexed
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
org.springframework.data.mongodb.core.mapping.Document
;
@Document
(
collection
=
"users"
)
@Document
(
collection
=
"users"
)
@Getter
@Getter
@Setter
@Setter
public
class
UserDocument
{
public
class
UserDocument
{
@Id
@Id
@Column
(
name
=
"id_usuario"
)
private
String
id
;
private
String
id
;
@Column
(
name
=
"nombre"
)
private
String
name
;
private
String
name
;
@Column
(
name
=
"apellidos"
)
private
String
surname
;
private
String
surname
;
@
Column
(
name
=
"email"
,
unique
=
true
)
@
Indexed
(
unique
=
true
)
private
String
email
;
private
String
email
;
@Column
(
name
=
"password"
)
private
String
password
;
private
String
password
;
@
Column
(
name
=
"usuario"
,
unique
=
true
)
@
Indexed
(
unique
=
true
)
private
String
username
;
private
String
username
;
}
}
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