Skip to content

Commit

Permalink
fixed Employee class for JPA
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoBettini committed May 13, 2019
1 parent da51b44 commit d057144
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/java/com/examples/spring/demo/model/Employee.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,22 @@

import java.util.Objects;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

@Entity
public class Employee {

@Id @GeneratedValue
private Long id;
private String name;
private long salary;

public Employee() {
// required for serialization/deserialization
}

public Employee(Long id, String name, long salary) {
this.id = id;
this.name = name;
Expand Down

0 comments on commit d057144

Please sign in to comment.