package ai.decompile.analysis.model.entity;

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

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

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

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

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

  @Column(name = "is_union", nullable = false)
  @Builder.Default
  private boolean isUnion = false;

  @Column(nullable = false, columnDefinition = "TEXT DEFAULT ''")
  @Builder.Default
  private String members = "";
}
