package com.upsfj.sfjprojectbackend.entity;

import jakarta.persistence.*;
import lombok.Data;
import org.springframework.data.relational.core.mapping.Table;

import java.util.List;
import java.util.Set;

@Data
@Entity
@Table(name = "sfj_algorithms")
public class Algorithm {

    @Id
    int algorithm_id;
    String algorithm_name;
    String algorithm_img;
    String algorithm_coder;
    @Column(columnDefinition = "TEXT")
    String algorithm_description;

//
//    @OneToMany()

    @Column(name = "algorithmFields")
    String fieldStr;
    @Column(name = "algorithmUserCases")
    String userStr;
    @Transient
    List<String> fieldList;
    @Transient
    List<String> useList;

    @OneToMany(mappedBy = "algorithm")
    Set<AlgorithmField> algorithmFields;
    @OneToMany(mappedBy = "algorithm")
    Set<AlgorithmUserCase> algorithmUserCases;
}
