Fix to email constraint
This commit is contained in:
parent
ce939cb7ea
commit
11d3679fdb
3 changed files with 9 additions and 7 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,3 +1,5 @@
|
||||||
|
.idea/misc.xml
|
||||||
|
|
||||||
**/.DS_Store
|
**/.DS_Store
|
||||||
|
|
||||||
# Compiled class file
|
# Compiled class file
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="false" project-jdk-name="11.0.3" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="false" project-jdk-name="12.0.1" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
|
@ -2,11 +2,7 @@ package ch.usi.inf.sa4.sanmarinoes.smarthut.models;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import javax.persistence.*;
|
import javax.persistence.*;
|
||||||
import javax.validation.constraints.Email;
|
import javax.validation.constraints.*;
|
||||||
import javax.validation.constraints.Min;
|
|
||||||
import javax.validation.constraints.NotEmpty;
|
|
||||||
import javax.validation.constraints.NotNull;
|
|
||||||
import javax.validation.constraints.Pattern;
|
|
||||||
|
|
||||||
/** A user of the Smarthut application */
|
/** A user of the Smarthut application */
|
||||||
@Entity(name = "smarthutuser")
|
@Entity(name = "smarthutuser")
|
||||||
|
@ -33,7 +29,11 @@ public class User {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Column(nullable = false)
|
@Column(nullable = false)
|
||||||
@NotEmpty(message = "Please provide a password")
|
@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;
|
private String password;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue