Skip to content
Snippets Groups Projects
Commit ed202d56 authored by Goik Martin's avatar Goik Martin
Browse files

serialVersionUID, id IDENTITY, longer attribute values

parent 71b4df8d
No related branches found
No related tags found
No related merge requests found
......@@ -13,20 +13,20 @@ import javax.validation.constraints.Size;
@Entity
public class User implements Serializable {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = -7123471572071976042L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@NotNull
@Column(nullable=false)
@Size(min=1, max=8)
@Size(min=1, max=40)
String name;
@NotNull
@Column(unique=true, nullable=false)
@Size(min=1, max=13)
@Size(min=1, max=40)
String email;
@NotNull
......@@ -34,6 +34,14 @@ public class User implements Serializable {
@Size(min=1)
String password;
public User() {}
public User(final String name, final String email, final String pasword) {
setName(name);
setEmail(email);
setPassword(pasword);
}
public Long getId() {
return id;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment