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.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "behaviorInfo")
public class BehaviorInfo extends ParamsContainer {
	private String behaviorType;
	private PluginUI pluginUI;
	private Set<Group> groups;

	@Column(name = "behaviorType")
	public String getBehaviorType() {
		return behaviorType;
	}

	public void setBehaviorType(String behaviorType) {
		this.behaviorType = behaviorType;
	}

	@ManyToOne
	@JoinColumn(name = "pluginUI", nullable = false)
	public PluginUI getPluginUI() {
		return pluginUI;
	}

	public void setPluginUI(PluginUI pluginUI) {
		this.pluginUI = pluginUI;
	}

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

	public void setGroups(Set<Group> groups) {
		this.groups = groups;
	}

}
