package ai.decompile.analysis.model.entity;

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

@Entity
@Table(
    name = "library_alias",
    uniqueConstraints = {@UniqueConstraint(columnNames = {"library_id", "alias"})})
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class LibraryAlias {
  @Id
  @GeneratedValue(strategy = GenerationType.UUID)
  private UUID id;

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

  @Column(nullable = false)
  private String alias;
}
