package edu.virginia.psyc.r01.persistence;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.mindtrails.domain.questionnaire.LinkedQuestionnaireData;

import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

/**
 * Created by Diheng on 7/27/17.
 */

@Entity
@Table(name="ReturnIntention")
@EqualsAndHashCode(callSuper = true)
@Data
public class ReturnIntention extends LinkedQuestionnaireData {

    @NotNull
    private Integer returnIntention;

    @Lob
    private String notReturnReason;
}
package edu.virginia.psyc.r01.persistence;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.mindtrails.domain.questionnaire.LinkedQuestionnaireData;

import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.Table;

/**
 * Created by Diheng on 7/27/17.
 */

@Entity
@Table(name="ReturnIntention")
@EqualsAndHashCode(callSuper = true)
@Data
public class ReturnIntention extends LinkedQuestionnaireData {
    private int returnIntention;

    @Lob
    private String notReturnReason;
}
--- 
+++ 
@@ -7,6 +7,7 @@
 import javax.persistence.Entity;
 import javax.persistence.Lob;
 import javax.persistence.Table;
+import javax.validation.constraints.NotNull;
 
 /**
  * Created by Diheng on 7/27/17.
@@ -17,7 +18,9 @@
 @EqualsAndHashCode(callSuper = true)
 @Data
 public class ReturnIntention extends LinkedQuestionnaireData {
-    private int returnIntention;
+
+    @NotNull
+    private Integer returnIntention;
 
     @Lob
     private String notReturnReason;
Add @NotNull validation to the Return Intention Java file. Keep all the form hydration logic in the HTML, because that form depends on Javascript to conditionally display a text box.
