content: package io.amplicode.blog.model;
  
  import jakarta.persistence.*;
  
  import java.time.Instant;
  import java.util.LinkedHashSet;
  import java.util.Set;
  
  @Entity
  @Table(name = "users", indexes = {
          @Index(name = "idx_user_names", columnList = "first_name, last_name")
  })
  public class User extends BaseEntity {
      @Column(name = "first_name", nullable = false)
      private String firstName;
  
      @Column(name = "last_name", nullable = false)
      private String lastName;
  
      @OneToMany(mappedBy = "author")
      private Set<Post> posts = new LinkedHashSet<>();
  
      @Column(name = "email")
      private String email;
  
      @Column(name = "last_activity")
      private Instant lastActivity;
  
      public Instant getLastActivity() {
          return lastActivity;
      }
  
      public void setLastActivity(Instant lastActivity) {
          this.lastActivity = lastActivity;
      }
  
      public String getEmail() {
          return email;
      }
  
      public void setEmail(String email) {
          this.email = email;
      }
  
      public String getFirstName() {
          return firstName;
      }
  
      public void setFirstName(String firstName) {
          this.firstName = firstName;
      }
  
      public String getLastName() {
          return lastName;
      }
  
      public void setLastName(String lastName) {
          this.lastName = lastName;
      }
  
      public Set<Post> getPosts() {
          return posts;
      }
  
      public void setPosts(Set<Post> posts) {
          this.posts = posts;
      }
  
  }