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