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.MappedCollection;
import org.springframework.data.relational.core.mapping.Table;

import jakarta.validation.constraints.Size;

@Table("measure_series")
public class MeasureSeries {

	@Id
    private Integer id;
    
    @Size(max = 1)
    private String measureSeriesCode;
    
    @MappedCollection(idColumn = "ref_id")
    private Set<MeasureSeriesDesc> measureSeriesDesc;

	public MeasureSeries(String measureSeriesCode) {
		this.measureSeriesCode = measureSeriesCode;
		this.measureSeriesDesc = new HashSet<>();
	}

	public Integer getId() {
        return id;
    }

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

    public String getMeasureSeriesCode() {
        return measureSeriesCode;
    }

    public void setMeasureSeriesCode(final String measureSeriesCode) {
        this.measureSeriesCode = measureSeriesCode;
    }

	public void addMeasureSeriesDesc(MeasureSeriesDesc measureSeriesDesc) {
		this.measureSeriesDesc.add(measureSeriesDesc);		
	}

}
