package org.bench4q.master.domain.entity.plugin;

import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "paramsContainer")
@Inheritance(strategy = InheritanceType.JOINED)
public abstract class ParamsContainer {
	private int id;
	private String name;
	private String nameCN;
	private Set<ParamInfo> params;

	@Id
	@GeneratedValue(strategy = GenerationType.TABLE)
	@Column(name = "id", nullable = false)
	public int getId() {
		return id;
	}

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

	@Column(name = "containerName", nullable = false)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "nameCN", nullable = true)
	public String getNameCN() {
		return nameCN;
	}

	public void setNameCN(String nameCN) {
		this.nameCN = nameCN;
	}

	@OneToMany(mappedBy = "paramsContainer", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.EAGER)
	public Set<ParamInfo> getParams() {
		return params;
	}

	public void setParams(Set<ParamInfo> params) {
		this.params = params;
	}

}
