package de.avatic.taricdb.model;

import java.util.Set;

import org.springframework.data.annotation.Id;
import org.springframework.data.jdbc.core.mapping.AggregateReference;
import org.springframework.data.relational.core.mapping.Column;
import org.springframework.data.relational.core.mapping.MappedCollection;
import org.springframework.data.relational.core.mapping.Table;

import jakarta.validation.constraints.NotNull;

@Table("import")
public class Import {

	@Id
    private Integer id;

    @NotNull
    @Column("nomenclature_id")
    private AggregateReference<Nomenclature, Integer> nomenclature;

    @Column("additional_code_id")
    private AggregateReference<AdditionalCode, Integer> additionalCode;

    @Column("geo_id")
    private AggregateReference<Geo, Integer> geo;

    @Column("geo_group_id")
    private AggregateReference<GeoGroup, Integer> geoGroup;   

    @MappedCollection(idColumn = "import_id")
    Set<AppliedMeasure> appliedMeasures;
    
    public Import(AggregateReference<Nomenclature, Integer> nomenclature,
			AggregateReference<AdditionalCode, Integer> additionalCode, Set<AppliedMeasure> appliedMeasures, AggregateReference<Geo,Integer> geo,
			AggregateReference<GeoGroup, Integer> geoGroup) {
		this.nomenclature = nomenclature;
		this.additionalCode = additionalCode;
		this.appliedMeasures = appliedMeasures;
		this.geo = geo;
		this.geoGroup = geoGroup;
	}



	public Integer getId() {
        return id;
    }

    public void setId(final Integer id) {
        this.id = id;
    }

    public AggregateReference<Nomenclature, Integer> getNomenclature() {
        return nomenclature;
    }

    public void setNomenclature(final AggregateReference<Nomenclature, Integer> nomenclature) {
        this.nomenclature = nomenclature;
    }

    public AggregateReference<AdditionalCode, Integer> getAdditionalCode() {
        return additionalCode;
    }

    public void setAdditionalCode(final AggregateReference<AdditionalCode, Integer> additionalCode) {
        this.additionalCode = additionalCode;
    }

    public AggregateReference<Geo, Integer> getGeo() {
        return geo;
    }

    public void setGeo(final AggregateReference<Geo, Integer> geo) {
        this.geo = geo;
    }

    public AggregateReference<GeoGroup, Integer> getGeoGroup() {
        return geoGroup;
    }

    public void setGeoGroup(final AggregateReference<GeoGroup, Integer> geoGroup) {
        this.geoGroup = geoGroup;
    }

}
