docs: updated example with lombok as per code (#1891)
This commit is contained in:
parent
785cbf42b7
commit
bee1283371
@ -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 ->
|
|
||||||
...
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user