forked from DevFW-CICD/spring-petclinic
improved pet creation form
This commit is contained in:
parent
ab5a3e29cb
commit
6eae69719f
6 changed files with 120 additions and 71 deletions
|
|
@ -12,9 +12,8 @@ import javax.persistence.Entity;
|
|||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.Table;
|
||||
import javax.validation.constraints.Digits;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import org.hibernate.validator.constraints.NotEmpty;
|
||||
import org.springframework.beans.support.MutableSortDefinition;
|
||||
import org.springframework.beans.support.PropertyComparator;
|
||||
import org.springframework.core.style.ToStringCreator;
|
||||
|
|
@ -30,15 +29,15 @@ import org.springframework.core.style.ToStringCreator;
|
|||
@Entity @Table(name="owners")
|
||||
public class Owner extends Person {
|
||||
@Column(name="address")
|
||||
@NotNull @Size(min = 1)
|
||||
@NotEmpty
|
||||
private String address;
|
||||
|
||||
@Column(name="city")
|
||||
@NotNull @Size(min = 1)
|
||||
@NotEmpty
|
||||
private String city;
|
||||
|
||||
@Column(name="telephone")
|
||||
@NotNull @Digits(fraction = 0, integer = 10)
|
||||
@NotEmpty @Digits(fraction = 0, integer = 10)
|
||||
private String telephone;
|
||||
|
||||
@OneToMany(cascade=CascadeType.ALL, mappedBy="owner")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue