package ai.decompile.analysis.model.entity;

import jakarta.persistence.*;
import java.time.Instant;
import java.util.UUID;
import lombok.*;
import org.hibernate.annotations.CreationTimestamp;

@Entity
@Table(name = "library_symbol")
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class LibrarySymbol {
  @Id
  @GeneratedValue(strategy = GenerationType.UUID)
  private UUID id;

  @ManyToOne(fetch = FetchType.LAZY)
  @JoinColumn(name = "library_id", nullable = false)
  private Library library;

  @Column(name = "module_name", nullable = false)
  private String moduleName;

  @Column(name = "class_name", length = 500)
  private String className;

  @Column(name = "symbol_name", nullable = false, length = 500)
  private String symbolName;

  @Column(nullable = false)
  private int ordinal;

  @Column(name = "symbol_type", length = 50)
  private String symbolType;

  @Column(length = 1000)
  private String parameters;

  @Column(length = 100)
  private String category;

  @CreationTimestamp
  @Column(name = "created_at", nullable = false, updatable = false)
  private Instant createdAt;
}
