package ai.decompile.analysis.model.entity;

import jakarta.persistence.*;
import java.util.UUID;
import lombok.*;

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

  @ManyToOne(fetch = FetchType.LAZY)
  @JoinColumn(name = "analysis_id", nullable = false)
  private StaticAnalysis analysis;

  @Column(nullable = false)
  private String dll;

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

  @Column(length = 20)
  private String address;

  @Column(nullable = false)
  @Builder.Default
  private int ordinal = 0;

  @ManyToOne(fetch = FetchType.LAZY)
  @JoinColumn(name = "library_symbol_id")
  private LibrarySymbol librarySymbol;

  @Column(name = "library_symbol_id", insertable = false, updatable = false)
  private UUID librarySymbolId;

  @Column(name = "resolved_name", length = 500)
  private String resolvedName;
}
