package ai.decompile.analysis.model.entity;

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

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

  @ManyToOne(fetch = FetchType.LAZY)
  @JoinColumn(name = "caller_id", nullable = false)
  private StaticFunction caller;

  @ManyToOne(fetch = FetchType.LAZY)
  @JoinColumn(name = "callee_id", nullable = false)
  private StaticFunction callee;

  @Column(nullable = false, length = 20)
  @Builder.Default
  private String type = "CALL";

  @Column(length = 20)
  private String address;
}
