package hello.entities;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.NotEmpty;

@Entity
public class Greeting {

	@Id
	@GeneratedValue
	private long id;

	@NotEmpty(message = "The greeting cannot be empty.")
	@Size(max = 30, message = "The greeting must have 30 characters or less.")
	@Pattern(regexp = ".*%s.*", message = "The greeting must include the %s placeholder.")
	private String template;

	public Greeting() {
	}

	public Greeting(String template) {
		this.template = template;
	}

	public long getId() {
		return this.id;
	}

	public String getTemplate() {
		return this.template;
	}

	public void setTemplate(String template) {
		this.template = template;
	}

	public String getGreeting(String name) {
		return String.format(this.template, name);
	}

	@Override
	public String toString() {
		return String.format("Greeting [id = %d, template = %s]", this.id, this.template);
	}
}

@@ -157,23 +157,24 @@
 traints.
-Pattern
+NotEmpty
 ;%0Aimport
@@ -207,43 +207,37 @@
 nts.
-Size;%0A%0Aimport org.hibernate
+Pattern;%0Aimport javax
 .validat
 or.c
@@ -232,18 +232,19 @@
 .validat
-or
+ion
 .constra
@@ -248,24 +248,20 @@
 traints.
-NotEmpty
+Size
 ;%0A%0A@Enti

Fix deprecated @NotEmpty annotation.