/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package org.mifosplatform.spm.domain;
import org.springframework.data.jpa.domain.AbstractPersistable;
import javax.persistence.*;
import java.util.Date;
import java.util.List;
@Entity
@Table(name = "m_surveys")
public class Survey extends AbstractPersistable<Long> {
@OneToMany(mappedBy = "survey", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
@OrderBy("sequenceNo")
private List<Component> components;
@OneToMany(mappedBy = "survey", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
@OrderBy("sequenceNo")
private List<Question> questions;
@Column(name = "a_key", length = 32)
private String key;
@Column(name = "a_name", length = 255)
private String name;
@Column(name = "description", length = 4096)
private String description;
@Column(name = "country_code", length = 2)
private String countryCode;
@Column(name = "valid_from")
@Temporal(value = TemporalType.TIMESTAMP)
private Date validFrom;
@Column(name = "valid_to")
@Temporal(value = TemporalType.TIMESTAMP)
private Date validTo;
public Survey() {
super();
}
public List<Component> getComponents() {
return components;
}
public void setComponents(List<Component> components) {
this.components = components;
}
public List<Question> getQuestions() {
return questions;
}
public void setQuestions(List<Question> questions) {
this.questions = questions;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getCountryCode() {
return countryCode;
}
public void setCountryCode(String countryCode) {
this.countryCode = countryCode;
}
public Date getValidFrom() {
return validFrom;
}
public void setValidFrom(Date validFrom) {
this.validFrom = validFrom;
}
public Date getValidTo() {
return validTo;
}
public void setValidTo(Date validTo) {
this.validTo = validTo;
}
}