diff --git a/pom.xml b/pom.xml
index 9d2fd77f0..5e1c8f867 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,11 +21,6 @@
UTF-8
arey
-
- 1.3
- 1.1.1
- 5.0.0.GA
-
3.3.6
1.11.4
@@ -71,27 +66,6 @@
jstl
-
-
- joda-time
- joda-time
-
-
- joda-time
- joda-time-hibernate
- ${jodatime-hibernate.version}
-
-
- joda-time
- joda-time-jsptags
- ${jodatime-jsptags.version}
-
-
- org.jadira.usertype
- usertype.core
- ${jadira-usertype-core.version}
-
-
org.hsqldb
diff --git a/src/main/java/org/springframework/samples/petclinic/model/Pet.java b/src/main/java/org/springframework/samples/petclinic/model/Pet.java
index 3dec7a310..205d529ff 100644
--- a/src/main/java/org/springframework/samples/petclinic/model/Pet.java
+++ b/src/main/java/org/springframework/samples/petclinic/model/Pet.java
@@ -15,11 +15,9 @@
*/
package org.springframework.samples.petclinic.model;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
+import org.springframework.beans.support.MutableSortDefinition;
+import org.springframework.beans.support.PropertyComparator;
+import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.CascadeType;
import javax.persistence.Column;
@@ -30,12 +28,14 @@ import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
-import org.hibernate.annotations.Type;
-import org.joda.time.DateTime;
-import org.joda.time.LocalDate;
-import org.springframework.beans.support.MutableSortDefinition;
-import org.springframework.beans.support.PropertyComparator;
-import org.springframework.format.annotation.DateTimeFormat;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
/**
* Simple business object representing a pet.
@@ -49,9 +49,9 @@ import org.springframework.format.annotation.DateTimeFormat;
public class Pet extends NamedEntity {
@Column(name = "birth_date")
- @Type(type = "org.jadira.usertype.dateandtime.joda.PersistentLocalDate")
+ @Temporal(TemporalType.DATE)
@DateTimeFormat(pattern = "yyyy/MM/dd")
- private LocalDate birthDate;
+ private Date birthDate;
@ManyToOne
@JoinColumn(name = "type_id")
@@ -64,12 +64,13 @@ public class Pet extends NamedEntity {
@OneToMany(cascade = CascadeType.ALL, mappedBy = "pet", fetch = FetchType.EAGER)
private Set visits;
- public LocalDate getBirthDate() {
- return this.birthDate;
+
+ public void setBirthDate(Date birthDate) {
+ this.birthDate = birthDate;
}
- public void setBirthDate(LocalDate birthDate) {
- this.birthDate = birthDate;
+ public Date getBirthDate() {
+ return this.birthDate;
}
public PetType getType() {
diff --git a/src/main/java/org/springframework/samples/petclinic/model/Visit.java b/src/main/java/org/springframework/samples/petclinic/model/Visit.java
index 023a8dcef..8fe9deb75 100644
--- a/src/main/java/org/springframework/samples/petclinic/model/Visit.java
+++ b/src/main/java/org/springframework/samples/petclinic/model/Visit.java
@@ -15,16 +15,17 @@
*/
package org.springframework.samples.petclinic.model;
+import org.hibernate.validator.constraints.NotEmpty;
+import org.springframework.format.annotation.DateTimeFormat;
+
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
-
-import org.hibernate.annotations.Type;
-import org.hibernate.validator.constraints.NotEmpty;
-import org.joda.time.LocalDate;
-import org.springframework.format.annotation.DateTimeFormat;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import java.util.Date;
/**
* Simple JavaBean domain object representing a visit.
@@ -39,9 +40,9 @@ public class Visit extends BaseEntity {
* Holds value of property date.
*/
@Column(name = "visit_date")
- @Type(type = "org.jadira.usertype.dateandtime.joda.PersistentLocalDate")
+ @Temporal(TemporalType.TIMESTAMP)
@DateTimeFormat(pattern = "yyyy/MM/dd")
- private LocalDate date;
+ private Date date;
/**
* Holds value of property description.
@@ -62,7 +63,7 @@ public class Visit extends BaseEntity {
* Creates a new instance of Visit for the current date
*/
public Visit() {
- this.date = new LocalDate();
+ this.date = new Date();
}
@@ -71,7 +72,7 @@ public class Visit extends BaseEntity {
*
* @return Value of property date.
*/
- public LocalDate getDate() {
+ public Date getDate() {
return this.date;
}
@@ -80,7 +81,7 @@ public class Visit extends BaseEntity {
*
* @param date New value of property date.
*/
- public void setDate(LocalDate date) {
+ public void setDate(Date date) {
this.date = date;
}
diff --git a/src/main/webapp/WEB-INF/jsp/owners/ownerDetails.jsp b/src/main/webapp/WEB-INF/jsp/owners/ownerDetails.jsp
index 7ca50f673..877e53e8b 100644
--- a/src/main/webapp/WEB-INF/jsp/owners/ownerDetails.jsp
+++ b/src/main/webapp/WEB-INF/jsp/owners/ownerDetails.jsp
@@ -3,7 +3,6 @@
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
-<%@ taglib prefix="joda" uri="http://www.joda.org/joda/time/tags" %>
<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags" %>
@@ -54,7 +53,7 @@
Name
Birth Date
-
+
Type
@@ -69,7 +68,7 @@
- |
+ |
|
diff --git a/src/main/webapp/WEB-INF/jsp/pets/createOrUpdateVisitForm.jsp b/src/main/webapp/WEB-INF/jsp/pets/createOrUpdateVisitForm.jsp
index df70223c0..b964e83d4 100644
--- a/src/main/webapp/WEB-INF/jsp/pets/createOrUpdateVisitForm.jsp
+++ b/src/main/webapp/WEB-INF/jsp/pets/createOrUpdateVisitForm.jsp
@@ -3,7 +3,6 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
-<%@ taglib prefix="joda" uri="http://www.joda.org/joda/time/tags" %>
<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags" %>
@@ -30,7 +29,7 @@
|
- |
+ |
|
|
@@ -60,7 +59,7 @@
- |
+ |
|
diff --git a/src/test/java/org/springframework/samples/petclinic/service/ClinicServiceSpringDataJpaTests.java b/src/test/java/org/springframework/samples/petclinic/service/ClinicServiceSpringDataJpaTests.java
index f29c2da68..d090b8295 100644
--- a/src/test/java/org/springframework/samples/petclinic/service/ClinicServiceSpringDataJpaTests.java
+++ b/src/test/java/org/springframework/samples/petclinic/service/ClinicServiceSpringDataJpaTests.java
@@ -1,6 +1,5 @@
package org.springframework.samples.petclinic.service;
-import org.joda.time.LocalDate;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
@@ -13,6 +12,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;
import java.util.Collection;
+import java.util.Date;
import static org.assertj.core.api.Assertions.assertThat;
@@ -123,7 +123,7 @@ public class ClinicServiceSpringDataJpaTests {
pet.setName("bowser");
Collection types = this.clinicService.findPetTypes();
pet.setType(EntityUtils.getById(types, PetType.class, 2));
- pet.setBirthDate(new LocalDate());
+ pet.setBirthDate(new Date());
owner6.addPet(pet);
assertThat(owner6.getPets().size()).isEqualTo(found + 1);