mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-17 21:15:50 +00:00
add @NonEmpty constraint for NamedEntity
This commit is contained in:
parent
056c1dfb94
commit
8d716f46fc
1 changed files with 3 additions and 0 deletions
|
@ -18,6 +18,8 @@ package org.springframework.samples.petclinic.model;
|
|||
import javax.persistence.Column;
|
||||
import javax.persistence.MappedSuperclass;
|
||||
|
||||
import org.hibernate.validator.constraints.NotEmpty;
|
||||
|
||||
|
||||
/**
|
||||
* Simple JavaBean domain object adds a name property to <code>BaseEntity</code>. Used as a base class for objects
|
||||
|
@ -30,6 +32,7 @@ import javax.persistence.MappedSuperclass;
|
|||
public class NamedEntity extends BaseEntity {
|
||||
|
||||
@Column(name = "name")
|
||||
@NotEmpty
|
||||
private String name;
|
||||
|
||||
public String getName() {
|
||||
|
|
Loading…
Reference in a new issue