Building a web application with Spring Boot and Angular (#6396)
* Initial Commit * Update pom.xml
This commit is contained in:
committed by
KevinGilmore
parent
9cee994496
commit
ad4ff82fa2
@@ -0,0 +1,43 @@
|
||||
package com.baeldung.application.entities;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
|
||||
@Entity
|
||||
public class User {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private long id;
|
||||
private final String name;
|
||||
private final String email;
|
||||
|
||||
public User() {
|
||||
this.name = "";
|
||||
this.email = "";
|
||||
}
|
||||
|
||||
public User(String name, String email) {
|
||||
this.name = name;
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "User{" + "id=" + id + ", name=" + name + ", email=" + email + '}';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user