content: package com.alifetvaci.credit.userservice.repository.model;
  
  
  import jakarta.persistence.Column;
  import jakarta.persistence.GeneratedValue;
  import jakarta.persistence.GenerationType;
  import jakarta.persistence.Id;
  import jakarta.persistence.MappedSuperclass;
  import lombok.AccessLevel;
  import lombok.EqualsAndHashCode;
  import lombok.Getter;
  import lombok.NoArgsConstructor;
  import lombok.experimental.SuperBuilder;
  import org.hibernate.annotations.CreationTimestamp;
  import org.hibernate.annotations.UpdateTimestamp;
  import org.springframework.data.annotation.Version;
  
  import java.time.LocalDateTime;
  
  @Getter
  @SuperBuilder
  @EqualsAndHashCode
  @NoArgsConstructor(access = AccessLevel.PROTECTED)
  @MappedSuperclass
  public abstract class BaseEntity {
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      @Column(name = "ID", updatable = false, nullable = false)
      private int id;
  
      @Version
      @Column(name = "VERSION", nullable = false)
      private int version;
  
      @Column(name = "DELETED", nullable = false)
      private boolean deleted;
  
      @CreationTimestamp
      @Column(name = "CREATED_AT", updatable = false, nullable = false)
      private LocalDateTime createdAt;
  
      @UpdateTimestamp
      @Column(name = "UPDATED_AT", insertable = false)
      private LocalDateTime updatedAt;
  }
  