Added a script that illustrates the example
[demos/spring/data-jdbc] / src / main / java / de / juplo / boot / data / jdbc / User.java
1 package de.juplo.boot.data.jdbc;
2
3 import lombok.*;
4 import org.springframework.data.annotation.Id;
5 import org.springframework.data.relational.core.mapping.Table;
6
7 import java.time.LocalDateTime;
8
9 @Table("users")
10 public class User {
11     @Id
12     Long id;
13     @Getter
14     @Setter
15     String username;
16     @Getter
17     @Setter
18     LocalDateTime created;
19     @Getter
20     @Setter
21     boolean loggedIn;
22
23     public User(String username, LocalDateTime created, boolean loggedIn) {
24         this.username = username;
25         this.created = created;
26         this.loggedIn = loggedIn;
27     }
28
29
30     @Override
31     public String toString() {
32         return username;
33     }
34 }