BaseEntity
.
* Used as a base class for objects needing these properties.
diff --git a/src/main/java/org/springframework/samples/petclinic/Owner.java b/src/main/java/org/springframework/samples/petclinic/Owner.java
index bde857ed2..65e3df8fe 100644
--- a/src/main/java/org/springframework/samples/petclinic/Owner.java
+++ b/src/main/java/org/springframework/samples/petclinic/Owner.java
@@ -12,8 +12,9 @@ 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;
@@ -24,19 +25,20 @@ import org.springframework.core.style.ToStringCreator;
* @author Ken Krebs
* @author Juergen Hoeller
* @author Sam Brannen
+ * @author Michael Isvy
*/
@Entity @Table(name="owners")
public class Owner extends Person {
@Column(name="address")
- @NotEmpty
+ @NotNull @Size(min = 1)
private String address;
- @Column(name="city")
- @NotEmpty
+ @Column(name="city")
+ @NotNull @Size(min = 1)
private String city;
@Column(name="telephone")
- @NotEmpty @Digits(fraction = 0, integer = 10)
+ @NotNull @Digits(fraction = 0, integer = 10)
private String telephone;
@OneToMany(cascade=CascadeType.ALL, mappedBy="owner")
diff --git a/src/main/java/org/springframework/samples/petclinic/web/EditPetController.java b/src/main/java/org/springframework/samples/petclinic/web/EditPetController.java
deleted file mode 100644
index 0a02fdaf2..000000000
--- a/src/main/java/org/springframework/samples/petclinic/web/EditPetController.java
+++ /dev/null
@@ -1,80 +0,0 @@
-
-package org.springframework.samples.petclinic.web;
-
-import java.util.Collection;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.samples.petclinic.Clinic;
-import org.springframework.samples.petclinic.Pet;
-import org.springframework.samples.petclinic.PetType;
-import org.springframework.samples.petclinic.validation.PetValidator;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
-import org.springframework.validation.BindingResult;
-import org.springframework.web.bind.WebDataBinder;
-import org.springframework.web.bind.annotation.InitBinder;
-import org.springframework.web.bind.annotation.ModelAttribute;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.SessionAttributes;
-import org.springframework.web.bind.support.SessionStatus;
-
-/**
- * JavaBean Form controller that is used to edit an existing Pet
.
- *
- * @author Juergen Hoeller
- * @author Ken Krebs
- * @author Arjen Poutsma
- */
-@Controller
-@RequestMapping("/owners/*/pets/{petId}/edit")
-@SessionAttributes("pet")
-public class EditPetController {
-
- private final Clinic clinic;
-
-
- @Autowired
- public EditPetController(Clinic clinic) {
- this.clinic = clinic;
- }
-
- @ModelAttribute("types")
- public Collection
- |
- |