package de.avatic.taricdb.model;

import java.util.HashSet;
import java.util.Set;

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

import jakarta.validation.constraints.Size;


public class Geo {

	@Id
    private Integer id;

    @Size(max = 2)
    @Column("iso_3166_code")
    private String iso3166Code;
    
    @MappedCollection(idColumn = "ref_id")
    private Set<GeoDesc> geoDesc;

    public Geo(String iso3166Code) {
		this.iso3166Code = iso3166Code;
		this.geoDesc = new HashSet<>();
	}

	public Integer getId() {
        return id;
    }

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

    public String getIso3166Code() {
        return iso3166Code;
    }

    public void setIso3166Code(final String iso3166Code) {
        this.iso3166Code = iso3166Code;
    }

	public void addGeoDescription(GeoDesc geoDesc) {
		this.geoDesc.add(geoDesc);
    
	}

}
