package dev.dinauer.maven.jpa.maven;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.persistence.*;

@Entity
@Table(name = "pom")
public class Pom
{
    @Id
    @GeneratedValue(strategy = GenerationType.UUID)
    private String id;

    @JsonIgnore
    @Column(columnDefinition = "TEXT")
    @Basic(fetch = FetchType.LAZY)
    private String pom;

    private String md5;

    private String sha1;

    private String url;

    private String filename;

    @OneToOne
    @JoinColumn(name = "version_id")
    @JsonBackReference
    private Version version;

    public String getId()
    {
        return id;
    }

    public Pom setId(String id)
    {
        this.id = id;
        return this;
    }

    public String getPom()
    {
        return pom;
    }

    public Pom setPom(String pom)
    {
        this.pom = pom;
        return this;
    }

    public String getMd5()
    {
        return md5;
    }

    public Pom setMd5(String md5)
    {
        this.md5 = md5;
        return this;
    }

    public String getSha1()
    {
        return sha1;
    }

    public Pom setSha1(String sha1)
    {
        this.sha1 = sha1;
        return this;
    }

    public Version getVersion()
    {
        return version;
    }

    public Pom setVersion(Version version)
    {
        this.version = version;
        return this;
    }

    public String getUrl()
    {
        return url;
    }

    public Pom setUrl(String url)
    {
        this.url = url;
        return this;
    }

    public String getFilename()
    {
        return filename;
    }

    public Pom setFilename(String filename)
    {
        this.filename = filename;
        return this;
    }
}
