From 11d3679fdb4d4ff2af13495b143a4b3ef27679c9 Mon Sep 17 00:00:00 2001 From: Claudio Maggioni Date: Fri, 28 Feb 2020 16:57:32 +0100 Subject: [PATCH] Fix to email constraint --- .gitignore | 2 ++ .idea/misc.xml | 2 +- .../inf/sa4/sanmarinoes/smarthut/models/User.java | 12 ++++++------ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 69ca520..1375525 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +.idea/misc.xml + **/.DS_Store # Compiled class file diff --git a/.idea/misc.xml b/.idea/misc.xml index 7c6191b..241f098 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,7 +1,7 @@ - + \ No newline at end of file diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/User.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/User.java index e4ce24e..7909fe8 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/User.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/User.java @@ -2,11 +2,7 @@ package ch.usi.inf.sa4.sanmarinoes.smarthut.models; import java.util.Set; import javax.persistence.*; -import javax.validation.constraints.Email; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Pattern; +import javax.validation.constraints.*; /** A user of the Smarthut application */ @Entity(name = "smarthutuser") @@ -33,7 +29,11 @@ public class User { @NotNull @Column(nullable = false) @NotEmpty(message = "Please provide a password") - @Min(value = 6, message = "Your password should be at least 6 characters long") + @Size( + min = 6, + max = 255, + message = + "Your password should be at least 6 characters long and at most 255 chars long") private String password; /**