docs: updated example with lombok as per code (#1891)

This commit is contained in:
Fiordy 2021-10-24 16:27:24 +02:00 committed by GitHub
parent 785cbf42b7
commit bee1283371
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,7 +39,13 @@ In plain words
Let's first look at the person entity that we need to persist.
```java
@ToString
@EqualsAndHashCode
@Setter
@Getter
@Entity
@NoArgsConstructor
public class Person {
@Id
@ -49,17 +55,15 @@ public class Person {
private String surname;
private int age;
public Person() {
}
/**
* Constructor.
*/
public Person(String name, String surname, int age) {
this.name = name;
this.surname = surname;
this.age = age;
}
// getters and setters ->
...
}
```