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_action")
public class MeasureAction {

	@Id
    private Integer id;
	
	@Size(max = 2)
    private String measureActionCode;
    
    @MappedCollection(idColumn = "ref_id")
    private Set<MeasureActionDesc> measureActionDesc;

    public MeasureAction(String measureActionCode) {
		this.measureActionCode = measureActionCode;
		this.measureActionDesc = new HashSet<>();
	}

	public Integer getId() {
        return id;
    }

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

    public String getMeasureActionCode() {
        return measureActionCode;
    }

    public void setMeasureActionCode(final String measureActionCode) {
        this.measureActionCode = measureActionCode;
    }
    
	public void addMeasureActionDesc(MeasureActionDesc measureActionDesc) {
		this.measureActionDesc.add(measureActionDesc);
	}

}
