/*
 *  Copyright (C) 2018 EPAM Systems
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

package com.epam.ta.reportportal.entity.project.email;

import com.epam.ta.reportportal.commons.SendCase;
import com.epam.ta.reportportal.entity.project.Project;

import javax.persistence.*;
import java.io.Serializable;
import java.util.List;

/**
 * @author Ivan Budayeu
 */
@Entity
@Table(name = "email_sender_case")
public class EmailSenderCase implements Serializable {

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;

	@ElementCollection(fetch = FetchType.EAGER)
	@CollectionTable(name = "recipients", joinColumns = @JoinColumn(name = "email_sender_case_id"))
	@Column(name = "recipient")
	private List<String> recipients;

	@ElementCollection(fetch = FetchType.EAGER)
	@CollectionTable(name = "launch_names", joinColumns = @JoinColumn(name = "email_sender_case_id"))
	@Column(name = "launch_name")
	private List<String> launchNames;

	@ElementCollection(fetch = FetchType.EAGER)
	@CollectionTable(name = "launch_tags", joinColumns = @JoinColumn(name = "email_sender_case_id"))
	@Column(name = "launch_tag")
	private List<String> launchTags;

	@Column(name = "send_case")
	private SendCase sendCase;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "project_id", nullable = false)
	private Project project;

	public EmailSenderCase() {
	}

	public EmailSenderCase(List<String> recipients, SendCase sendCase) {
		this.recipients = recipients;
		this.sendCase = sendCase;
	}

	public Long getId() {
		return id;
	}

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

	public List<String> getRecipients() {
		return recipients;
	}

	public void setRecipients(List<String> recipients) {
		this.recipients = recipients;
	}

	public List<String> getLaunchNames() {
		return launchNames;
	}

	public void setLaunchNames(List<String> launchNames) {
		this.launchNames = launchNames;
	}

	public List<String> getLaunchTags() {
		return launchTags;
	}

	public void setLaunchTags(List<String> launchTags) {
		this.launchTags = launchTags;
	}

	public SendCase getSendCase() {
		return sendCase;
	}

	public void setSendCase(SendCase sendCase) {
		this.sendCase = sendCase;
	}

	public Project getProject() {
		return project;
	}

	public void setProject(Project project) {
		this.project = project;
	}
}
@@ -838,19 +838,18 @@
 va.util.
-Lis
+Se
 t;%0A%0A/**%0A
@@ -1224,35 +1224,34 @@
 ient%22)%0A%09private 
-Lis
+Se
 t%3CString%3E recipi
@@ -1433,35 +1433,34 @@
 name%22)%0A%09private 
-Lis
+Se
 t%3CString%3E launch
@@ -1649,19 +1649,18 @@
 private 
-Lis
+Se
 t%3CString
@@ -1903,19 +1903,18 @@
 derCase(
-Lis
+Se
 t%3CString
@@ -1926,16 +1926,65 @@
 ipients,
+ Set%3CString%3E launchNames, Set%3CString%3E launchTags,
  SendCas
@@ -2029,16 +2029,82 @@
 pients;%0A
+%09%09this.launchNames = launchNames;%0A%09%09this.launchTags = launchTags;%0A
 %09%09this.s
@@ -2217,35 +2217,34 @@
 id;%0A%09%7D%0A%0A%09public 
-Lis
+Se
 t%3CString%3E getRec
@@ -2307,19 +2307,18 @@
 ipients(
-Lis
+Se
 t%3CString
@@ -2369,35 +2369,34 @@
 ts;%0A%09%7D%0A%0A%09public 
-Lis
+Se
 t%3CString%3E getLau
@@ -2462,19 +2462,18 @@
 chNames(
-Lis
+Se
 t%3CString
@@ -2535,19 +2535,18 @@
 %09public 
-Lis
+Se
 t%3CString
@@ -2621,11 +2621,10 @@
 ags(
-Lis
+Se
 t%3CSt

fix email sender case