From 23314c5428dcf4920bce09151c7d5000f1421017 Mon Sep 17 00:00:00 2001 From: Mic Date: Wed, 13 Feb 2013 08:06:37 +0800 Subject: [PATCH] moved all model classes to a dedicated 'model' package --- .../samples/petclinic/{ => model}/BaseEntity.java | 2 +- .../samples/petclinic/{ => model}/NamedEntity.java | 2 +- .../samples/petclinic/{ => model}/Owner.java | 2 +- .../samples/petclinic/{ => model}/Person.java | 2 +- .../samples/petclinic/{ => model}/Pet.java | 2 +- .../samples/petclinic/{ => model}/PetType.java | 2 +- .../samples/petclinic/{ => model}/Specialty.java | 2 +- .../samples/petclinic/{ => model}/Vet.java | 2 +- .../samples/petclinic/{ => model}/Vets.java | 2 +- .../samples/petclinic/{ => model}/Visit.java | 2 +- .../samples/petclinic/{ => model}/package-info.java | 2 +- .../samples/petclinic/repository/OwnerRepository.java | 4 ++-- .../samples/petclinic/repository/PetRepository.java | 6 +++--- .../samples/petclinic/repository/VetRepository.java | 2 +- .../samples/petclinic/repository/VisitRepository.java | 4 ++-- .../repository/jdbc/JdbcOwnerRepositoryImpl.java | 8 ++++---- .../samples/petclinic/repository/jdbc/JdbcPet.java | 2 +- .../repository/jdbc/JdbcPetRepositoryImpl.java | 8 ++++---- .../repository/jdbc/JdbcVetRepositoryImpl.java | 6 +++--- .../repository/jdbc/JdbcVisitRepositoryImpl.java | 2 +- .../repository/jpa/JpaOwnerRepositoryImpl.java | 2 +- .../petclinic/repository/jpa/JpaPetRepositoryImpl.java | 4 ++-- .../petclinic/repository/jpa/JpaVetRepositoryImpl.java | 2 +- .../repository/jpa/JpaVisitRepositoryImpl.java | 2 +- .../springdatajpa/JpaOwnerRepositoryImpl.java | 2 +- .../springdatajpa/SpringDataPetRepository.java | 4 ++-- .../springdatajpa/SpringDataVetRepository.java | 2 +- .../springdatajpa/SpringDataVisitRepository.java | 2 +- .../samples/petclinic/service/ClinicService.java | 10 +++++----- .../samples/petclinic/service/ClinicServiceImpl.java | 10 +++++----- .../samples/petclinic/util/EntityUtils.java | 4 ++-- .../samples/petclinic/web/OwnerController.java | 2 +- .../samples/petclinic/web/PetController.java | 6 +++--- .../samples/petclinic/web/PetTypeFormatter.java | 2 +- .../samples/petclinic/web/PetValidator.java | 2 +- .../samples/petclinic/web/VetController.java | 2 +- .../samples/petclinic/web/VisitController.java | 4 ++-- .../samples/petclinic/web/VisitsAtomView.java | 2 +- src/main/resources/META-INF/aop.xml | 8 ++++---- src/main/resources/spring/jdbc.properties | 2 +- src/main/webapp/WEB-INF/mvc-view-config.xml | 2 +- .../petclinic/AbstractOwnerRepositoryTests.java | 1 + .../samples/petclinic/AbstractPetRepositoryTests.java | 3 +++ .../samples/petclinic/AbstractVetRepositoryTests.java | 1 + .../petclinic/AbstractVisitRepositoryTests.java | 2 ++ .../springframework/samples/petclinic/OwnerTests.java | 2 ++ .../samples/petclinic/web/VisitsAtomViewTest.java | 6 +++--- 47 files changed, 82 insertions(+), 73 deletions(-) rename src/main/java/org/springframework/samples/petclinic/{ => model}/BaseEntity.java (92%) rename src/main/java/org/springframework/samples/petclinic/{ => model}/NamedEntity.java (91%) rename src/main/java/org/springframework/samples/petclinic/{ => model}/Owner.java (98%) rename src/main/java/org/springframework/samples/petclinic/{ => model}/Person.java (92%) rename src/main/java/org/springframework/samples/petclinic/{ => model}/Pet.java (97%) rename src/main/java/org/springframework/samples/petclinic/{ => model}/PetType.java (76%) rename src/main/java/org/springframework/samples/petclinic/{ => model}/Specialty.java (82%) rename src/main/java/org/springframework/samples/petclinic/{ => model}/Vet.java (96%) rename src/main/java/org/springframework/samples/petclinic/{ => model}/Vets.java (95%) rename src/main/java/org/springframework/samples/petclinic/{ => model}/Visit.java (97%) rename src/main/java/org/springframework/samples/petclinic/{ => model}/package-info.java (58%) diff --git a/src/main/java/org/springframework/samples/petclinic/BaseEntity.java b/src/main/java/org/springframework/samples/petclinic/model/BaseEntity.java similarity index 92% rename from src/main/java/org/springframework/samples/petclinic/BaseEntity.java rename to src/main/java/org/springframework/samples/petclinic/model/BaseEntity.java index 69cb3b4..a5498de 100644 --- a/src/main/java/org/springframework/samples/petclinic/BaseEntity.java +++ b/src/main/java/org/springframework/samples/petclinic/model/BaseEntity.java @@ -1,4 +1,4 @@ -package org.springframework.samples.petclinic; +package org.springframework.samples.petclinic.model; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; diff --git a/src/main/java/org/springframework/samples/petclinic/NamedEntity.java b/src/main/java/org/springframework/samples/petclinic/model/NamedEntity.java similarity index 91% rename from src/main/java/org/springframework/samples/petclinic/NamedEntity.java rename to src/main/java/org/springframework/samples/petclinic/model/NamedEntity.java index 18c4714..c4137b9 100644 --- a/src/main/java/org/springframework/samples/petclinic/NamedEntity.java +++ b/src/main/java/org/springframework/samples/petclinic/model/NamedEntity.java @@ -1,4 +1,4 @@ -package org.springframework.samples.petclinic; +package org.springframework.samples.petclinic.model; import javax.persistence.Column; import javax.persistence.MappedSuperclass; diff --git a/src/main/java/org/springframework/samples/petclinic/Owner.java b/src/main/java/org/springframework/samples/petclinic/model/Owner.java similarity index 98% rename from src/main/java/org/springframework/samples/petclinic/Owner.java rename to src/main/java/org/springframework/samples/petclinic/model/Owner.java index 4bf7f09..a751c0c 100644 --- a/src/main/java/org/springframework/samples/petclinic/Owner.java +++ b/src/main/java/org/springframework/samples/petclinic/model/Owner.java @@ -1,4 +1,4 @@ -package org.springframework.samples.petclinic; +package org.springframework.samples.petclinic.model; import java.util.ArrayList; import java.util.Collections; diff --git a/src/main/java/org/springframework/samples/petclinic/Person.java b/src/main/java/org/springframework/samples/petclinic/model/Person.java similarity index 92% rename from src/main/java/org/springframework/samples/petclinic/Person.java rename to src/main/java/org/springframework/samples/petclinic/model/Person.java index d42bf04..dab7b11 100644 --- a/src/main/java/org/springframework/samples/petclinic/Person.java +++ b/src/main/java/org/springframework/samples/petclinic/model/Person.java @@ -1,4 +1,4 @@ -package org.springframework.samples.petclinic; +package org.springframework.samples.petclinic.model; import javax.persistence.Column; import javax.persistence.MappedSuperclass; diff --git a/src/main/java/org/springframework/samples/petclinic/Pet.java b/src/main/java/org/springframework/samples/petclinic/model/Pet.java similarity index 97% rename from src/main/java/org/springframework/samples/petclinic/Pet.java rename to src/main/java/org/springframework/samples/petclinic/model/Pet.java index fae7385..f9c9f4c 100644 --- a/src/main/java/org/springframework/samples/petclinic/Pet.java +++ b/src/main/java/org/springframework/samples/petclinic/model/Pet.java @@ -1,4 +1,4 @@ -package org.springframework.samples.petclinic; +package org.springframework.samples.petclinic.model; import java.util.ArrayList; import java.util.Collections; diff --git a/src/main/java/org/springframework/samples/petclinic/PetType.java b/src/main/java/org/springframework/samples/petclinic/model/PetType.java similarity index 76% rename from src/main/java/org/springframework/samples/petclinic/PetType.java rename to src/main/java/org/springframework/samples/petclinic/model/PetType.java index 4e4cebc..5a3b1fa 100644 --- a/src/main/java/org/springframework/samples/petclinic/PetType.java +++ b/src/main/java/org/springframework/samples/petclinic/model/PetType.java @@ -1,4 +1,4 @@ -package org.springframework.samples.petclinic; +package org.springframework.samples.petclinic.model; import javax.persistence.Entity; import javax.persistence.Table; diff --git a/src/main/java/org/springframework/samples/petclinic/Specialty.java b/src/main/java/org/springframework/samples/petclinic/model/Specialty.java similarity index 82% rename from src/main/java/org/springframework/samples/petclinic/Specialty.java rename to src/main/java/org/springframework/samples/petclinic/model/Specialty.java index 08a6e85..a050271 100644 --- a/src/main/java/org/springframework/samples/petclinic/Specialty.java +++ b/src/main/java/org/springframework/samples/petclinic/model/Specialty.java @@ -1,4 +1,4 @@ -package org.springframework.samples.petclinic; +package org.springframework.samples.petclinic.model; import javax.persistence.Entity; import javax.persistence.Table; diff --git a/src/main/java/org/springframework/samples/petclinic/Vet.java b/src/main/java/org/springframework/samples/petclinic/model/Vet.java similarity index 96% rename from src/main/java/org/springframework/samples/petclinic/Vet.java rename to src/main/java/org/springframework/samples/petclinic/model/Vet.java index 744288b..70fbaa1 100644 --- a/src/main/java/org/springframework/samples/petclinic/Vet.java +++ b/src/main/java/org/springframework/samples/petclinic/model/Vet.java @@ -1,4 +1,4 @@ -package org.springframework.samples.petclinic; +package org.springframework.samples.petclinic.model; import java.util.ArrayList; import java.util.Collections; diff --git a/src/main/java/org/springframework/samples/petclinic/Vets.java b/src/main/java/org/springframework/samples/petclinic/model/Vets.java similarity index 95% rename from src/main/java/org/springframework/samples/petclinic/Vets.java rename to src/main/java/org/springframework/samples/petclinic/model/Vets.java index ae2367e..21a8ed2 100644 --- a/src/main/java/org/springframework/samples/petclinic/Vets.java +++ b/src/main/java/org/springframework/samples/petclinic/model/Vets.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.samples.petclinic; +package org.springframework.samples.petclinic.model; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/org/springframework/samples/petclinic/Visit.java b/src/main/java/org/springframework/samples/petclinic/model/Visit.java similarity index 97% rename from src/main/java/org/springframework/samples/petclinic/Visit.java rename to src/main/java/org/springframework/samples/petclinic/model/Visit.java index 72227ae..6a4bfc0 100644 --- a/src/main/java/org/springframework/samples/petclinic/Visit.java +++ b/src/main/java/org/springframework/samples/petclinic/model/Visit.java @@ -1,4 +1,4 @@ -package org.springframework.samples.petclinic; +package org.springframework.samples.petclinic.model; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/src/main/java/org/springframework/samples/petclinic/package-info.java b/src/main/java/org/springframework/samples/petclinic/model/package-info.java similarity index 58% rename from src/main/java/org/springframework/samples/petclinic/package-info.java rename to src/main/java/org/springframework/samples/petclinic/model/package-info.java index f2cc369..2723dc9 100644 --- a/src/main/java/org/springframework/samples/petclinic/package-info.java +++ b/src/main/java/org/springframework/samples/petclinic/model/package-info.java @@ -4,5 +4,5 @@ * The classes in this package represent PetClinic's business layer. * */ -package org.springframework.samples.petclinic; +package org.springframework.samples.petclinic.model; diff --git a/src/main/java/org/springframework/samples/petclinic/repository/OwnerRepository.java b/src/main/java/org/springframework/samples/petclinic/repository/OwnerRepository.java index 4a24d54..f874561 100644 --- a/src/main/java/org/springframework/samples/petclinic/repository/OwnerRepository.java +++ b/src/main/java/org/springframework/samples/petclinic/repository/OwnerRepository.java @@ -3,8 +3,8 @@ package org.springframework.samples.petclinic.repository; import java.util.Collection; import org.springframework.dao.DataAccessException; -import org.springframework.samples.petclinic.BaseEntity; -import org.springframework.samples.petclinic.Owner; +import org.springframework.samples.petclinic.model.BaseEntity; +import org.springframework.samples.petclinic.model.Owner; /** * The high-level PetClinic business interface. diff --git a/src/main/java/org/springframework/samples/petclinic/repository/PetRepository.java b/src/main/java/org/springframework/samples/petclinic/repository/PetRepository.java index 68656ba..c708942 100644 --- a/src/main/java/org/springframework/samples/petclinic/repository/PetRepository.java +++ b/src/main/java/org/springframework/samples/petclinic/repository/PetRepository.java @@ -3,9 +3,9 @@ package org.springframework.samples.petclinic.repository; import java.util.List; import org.springframework.dao.DataAccessException; -import org.springframework.samples.petclinic.BaseEntity; -import org.springframework.samples.petclinic.Pet; -import org.springframework.samples.petclinic.PetType; +import org.springframework.samples.petclinic.model.BaseEntity; +import org.springframework.samples.petclinic.model.Pet; +import org.springframework.samples.petclinic.model.PetType; /** * The high-level PetClinic business interface. diff --git a/src/main/java/org/springframework/samples/petclinic/repository/VetRepository.java b/src/main/java/org/springframework/samples/petclinic/repository/VetRepository.java index 3fe4ff1..53c8c12 100644 --- a/src/main/java/org/springframework/samples/petclinic/repository/VetRepository.java +++ b/src/main/java/org/springframework/samples/petclinic/repository/VetRepository.java @@ -3,7 +3,7 @@ package org.springframework.samples.petclinic.repository; import java.util.Collection; import org.springframework.dao.DataAccessException; -import org.springframework.samples.petclinic.Vet; +import org.springframework.samples.petclinic.model.Vet; /** * The high-level PetClinic business interface. diff --git a/src/main/java/org/springframework/samples/petclinic/repository/VisitRepository.java b/src/main/java/org/springframework/samples/petclinic/repository/VisitRepository.java index d3e7f8d..36ea422 100644 --- a/src/main/java/org/springframework/samples/petclinic/repository/VisitRepository.java +++ b/src/main/java/org/springframework/samples/petclinic/repository/VisitRepository.java @@ -3,8 +3,8 @@ package org.springframework.samples.petclinic.repository; import java.util.List; import org.springframework.dao.DataAccessException; -import org.springframework.samples.petclinic.BaseEntity; -import org.springframework.samples.petclinic.Visit; +import org.springframework.samples.petclinic.model.BaseEntity; +import org.springframework.samples.petclinic.model.Visit; /** * The high-level PetClinic business interface. diff --git a/src/main/java/org/springframework/samples/petclinic/repository/jdbc/JdbcOwnerRepositoryImpl.java b/src/main/java/org/springframework/samples/petclinic/repository/jdbc/JdbcOwnerRepositoryImpl.java index 0b35952..2714759 100644 --- a/src/main/java/org/springframework/samples/petclinic/repository/jdbc/JdbcOwnerRepositoryImpl.java +++ b/src/main/java/org/springframework/samples/petclinic/repository/jdbc/JdbcOwnerRepositoryImpl.java @@ -15,10 +15,10 @@ import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; import org.springframework.jdbc.core.simple.ParameterizedBeanPropertyRowMapper; import org.springframework.jdbc.core.simple.SimpleJdbcInsert; import org.springframework.orm.ObjectRetrievalFailureException; -import org.springframework.samples.petclinic.Owner; -import org.springframework.samples.petclinic.Pet; -import org.springframework.samples.petclinic.PetType; -import org.springframework.samples.petclinic.Visit; +import org.springframework.samples.petclinic.model.Owner; +import org.springframework.samples.petclinic.model.Pet; +import org.springframework.samples.petclinic.model.PetType; +import org.springframework.samples.petclinic.model.Visit; import org.springframework.samples.petclinic.repository.OwnerRepository; import org.springframework.samples.petclinic.repository.VisitRepository; import org.springframework.samples.petclinic.util.EntityUtils; diff --git a/src/main/java/org/springframework/samples/petclinic/repository/jdbc/JdbcPet.java b/src/main/java/org/springframework/samples/petclinic/repository/jdbc/JdbcPet.java index 4a9ccf3..a652fe8 100644 --- a/src/main/java/org/springframework/samples/petclinic/repository/jdbc/JdbcPet.java +++ b/src/main/java/org/springframework/samples/petclinic/repository/jdbc/JdbcPet.java @@ -1,6 +1,6 @@ package org.springframework.samples.petclinic.repository.jdbc; -import org.springframework.samples.petclinic.Pet; +import org.springframework.samples.petclinic.model.Pet; /** * Subclass of Pet that carries temporary id properties which diff --git a/src/main/java/org/springframework/samples/petclinic/repository/jdbc/JdbcPetRepositoryImpl.java b/src/main/java/org/springframework/samples/petclinic/repository/jdbc/JdbcPetRepositoryImpl.java index 5c92c25..d7af9e7 100644 --- a/src/main/java/org/springframework/samples/petclinic/repository/jdbc/JdbcPetRepositoryImpl.java +++ b/src/main/java/org/springframework/samples/petclinic/repository/jdbc/JdbcPetRepositoryImpl.java @@ -14,10 +14,10 @@ import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; import org.springframework.jdbc.core.simple.ParameterizedBeanPropertyRowMapper; import org.springframework.jdbc.core.simple.SimpleJdbcInsert; import org.springframework.orm.ObjectRetrievalFailureException; -import org.springframework.samples.petclinic.Owner; -import org.springframework.samples.petclinic.Pet; -import org.springframework.samples.petclinic.PetType; -import org.springframework.samples.petclinic.Visit; +import org.springframework.samples.petclinic.model.Owner; +import org.springframework.samples.petclinic.model.Pet; +import org.springframework.samples.petclinic.model.PetType; +import org.springframework.samples.petclinic.model.Visit; import org.springframework.samples.petclinic.repository.OwnerRepository; import org.springframework.samples.petclinic.repository.PetRepository; import org.springframework.samples.petclinic.repository.VisitRepository; diff --git a/src/main/java/org/springframework/samples/petclinic/repository/jdbc/JdbcVetRepositoryImpl.java b/src/main/java/org/springframework/samples/petclinic/repository/jdbc/JdbcVetRepositoryImpl.java index c6acf37..1afaf8f 100644 --- a/src/main/java/org/springframework/samples/petclinic/repository/jdbc/JdbcVetRepositoryImpl.java +++ b/src/main/java/org/springframework/samples/petclinic/repository/jdbc/JdbcVetRepositoryImpl.java @@ -14,8 +14,8 @@ import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.simple.ParameterizedBeanPropertyRowMapper; import org.springframework.jdbc.core.simple.ParameterizedRowMapper; import org.springframework.jmx.export.annotation.ManagedOperation; -import org.springframework.samples.petclinic.Specialty; -import org.springframework.samples.petclinic.Vet; +import org.springframework.samples.petclinic.model.Specialty; +import org.springframework.samples.petclinic.model.Vet; import org.springframework.samples.petclinic.repository.VetRepository; import org.springframework.samples.petclinic.util.EntityUtils; import org.springframework.stereotype.Repository; @@ -46,7 +46,7 @@ public class JdbcVetRepositoryImpl implements VetRepository { /** * Refresh the cache of Vets that the ClinicService is holding. - * @see org.springframework.samples.petclinic.service.ClinicService#findVets() + * @see org.springframework.samples.petclinic.model.service.ClinicService#findVets() */ @ManagedOperation @Transactional(readOnly = true) diff --git a/src/main/java/org/springframework/samples/petclinic/repository/jdbc/JdbcVisitRepositoryImpl.java b/src/main/java/org/springframework/samples/petclinic/repository/jdbc/JdbcVisitRepositoryImpl.java index 5be02e7..d9e77fb 100644 --- a/src/main/java/org/springframework/samples/petclinic/repository/jdbc/JdbcVisitRepositoryImpl.java +++ b/src/main/java/org/springframework/samples/petclinic/repository/jdbc/JdbcVisitRepositoryImpl.java @@ -14,7 +14,7 @@ import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.namedparam.MapSqlParameterSource; import org.springframework.jdbc.core.simple.ParameterizedRowMapper; import org.springframework.jdbc.core.simple.SimpleJdbcInsert; -import org.springframework.samples.petclinic.Visit; +import org.springframework.samples.petclinic.model.Visit; import org.springframework.samples.petclinic.repository.VisitRepository; import org.springframework.samples.petclinic.service.ClinicService; import org.springframework.stereotype.Repository; diff --git a/src/main/java/org/springframework/samples/petclinic/repository/jpa/JpaOwnerRepositoryImpl.java b/src/main/java/org/springframework/samples/petclinic/repository/jpa/JpaOwnerRepositoryImpl.java index a0c7b22..ab679d2 100644 --- a/src/main/java/org/springframework/samples/petclinic/repository/jpa/JpaOwnerRepositoryImpl.java +++ b/src/main/java/org/springframework/samples/petclinic/repository/jpa/JpaOwnerRepositoryImpl.java @@ -6,7 +6,7 @@ import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.Query; -import org.springframework.samples.petclinic.Owner; +import org.springframework.samples.petclinic.model.Owner; import org.springframework.samples.petclinic.repository.OwnerRepository; import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; diff --git a/src/main/java/org/springframework/samples/petclinic/repository/jpa/JpaPetRepositoryImpl.java b/src/main/java/org/springframework/samples/petclinic/repository/jpa/JpaPetRepositoryImpl.java index 9a131f0..84e9705 100644 --- a/src/main/java/org/springframework/samples/petclinic/repository/jpa/JpaPetRepositoryImpl.java +++ b/src/main/java/org/springframework/samples/petclinic/repository/jpa/JpaPetRepositoryImpl.java @@ -5,8 +5,8 @@ import java.util.List; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; -import org.springframework.samples.petclinic.Pet; -import org.springframework.samples.petclinic.PetType; +import org.springframework.samples.petclinic.model.Pet; +import org.springframework.samples.petclinic.model.PetType; import org.springframework.samples.petclinic.repository.PetRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/org/springframework/samples/petclinic/repository/jpa/JpaVetRepositoryImpl.java b/src/main/java/org/springframework/samples/petclinic/repository/jpa/JpaVetRepositoryImpl.java index 04ee001..63a4e72 100644 --- a/src/main/java/org/springframework/samples/petclinic/repository/jpa/JpaVetRepositoryImpl.java +++ b/src/main/java/org/springframework/samples/petclinic/repository/jpa/JpaVetRepositoryImpl.java @@ -5,7 +5,7 @@ import java.util.Collection; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; -import org.springframework.samples.petclinic.Vet; +import org.springframework.samples.petclinic.model.Vet; import org.springframework.samples.petclinic.repository.VetRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/org/springframework/samples/petclinic/repository/jpa/JpaVisitRepositoryImpl.java b/src/main/java/org/springframework/samples/petclinic/repository/jpa/JpaVisitRepositoryImpl.java index ddca820..0c6630c 100644 --- a/src/main/java/org/springframework/samples/petclinic/repository/jpa/JpaVisitRepositoryImpl.java +++ b/src/main/java/org/springframework/samples/petclinic/repository/jpa/JpaVisitRepositoryImpl.java @@ -8,7 +8,7 @@ import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.Query; -import org.springframework.samples.petclinic.Visit; +import org.springframework.samples.petclinic.model.Visit; import org.springframework.samples.petclinic.repository.VisitRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/org/springframework/samples/petclinic/repository/springdatajpa/JpaOwnerRepositoryImpl.java b/src/main/java/org/springframework/samples/petclinic/repository/springdatajpa/JpaOwnerRepositoryImpl.java index 6e88ea0..e7e961e 100644 --- a/src/main/java/org/springframework/samples/petclinic/repository/springdatajpa/JpaOwnerRepositoryImpl.java +++ b/src/main/java/org/springframework/samples/petclinic/repository/springdatajpa/JpaOwnerRepositoryImpl.java @@ -6,7 +6,7 @@ import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.Query; -import org.springframework.samples.petclinic.Owner; +import org.springframework.samples.petclinic.model.Owner; import org.springframework.samples.petclinic.repository.OwnerRepository; import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; diff --git a/src/main/java/org/springframework/samples/petclinic/repository/springdatajpa/SpringDataPetRepository.java b/src/main/java/org/springframework/samples/petclinic/repository/springdatajpa/SpringDataPetRepository.java index dd73544..67dc56e 100644 --- a/src/main/java/org/springframework/samples/petclinic/repository/springdatajpa/SpringDataPetRepository.java +++ b/src/main/java/org/springframework/samples/petclinic/repository/springdatajpa/SpringDataPetRepository.java @@ -5,8 +5,8 @@ import java.util.List; import org.springframework.dao.DataAccessException; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.Repository; -import org.springframework.samples.petclinic.Pet; -import org.springframework.samples.petclinic.PetType; +import org.springframework.samples.petclinic.model.Pet; +import org.springframework.samples.petclinic.model.PetType; import org.springframework.samples.petclinic.repository.PetRepository; /** diff --git a/src/main/java/org/springframework/samples/petclinic/repository/springdatajpa/SpringDataVetRepository.java b/src/main/java/org/springframework/samples/petclinic/repository/springdatajpa/SpringDataVetRepository.java index 5a92690..bb02bd7 100644 --- a/src/main/java/org/springframework/samples/petclinic/repository/springdatajpa/SpringDataVetRepository.java +++ b/src/main/java/org/springframework/samples/petclinic/repository/springdatajpa/SpringDataVetRepository.java @@ -1,7 +1,7 @@ package org.springframework.samples.petclinic.repository.springdatajpa; import org.springframework.data.repository.Repository; -import org.springframework.samples.petclinic.Vet; +import org.springframework.samples.petclinic.model.Vet; import org.springframework.samples.petclinic.repository.VetRepository; /** diff --git a/src/main/java/org/springframework/samples/petclinic/repository/springdatajpa/SpringDataVisitRepository.java b/src/main/java/org/springframework/samples/petclinic/repository/springdatajpa/SpringDataVisitRepository.java index 77f072b..fc5bbcd 100644 --- a/src/main/java/org/springframework/samples/petclinic/repository/springdatajpa/SpringDataVisitRepository.java +++ b/src/main/java/org/springframework/samples/petclinic/repository/springdatajpa/SpringDataVisitRepository.java @@ -1,7 +1,7 @@ package org.springframework.samples.petclinic.repository.springdatajpa; import org.springframework.data.repository.Repository; -import org.springframework.samples.petclinic.Visit; +import org.springframework.samples.petclinic.model.Visit; import org.springframework.samples.petclinic.repository.VisitRepository; /** diff --git a/src/main/java/org/springframework/samples/petclinic/service/ClinicService.java b/src/main/java/org/springframework/samples/petclinic/service/ClinicService.java index d2a6ebb..b0f91fb 100644 --- a/src/main/java/org/springframework/samples/petclinic/service/ClinicService.java +++ b/src/main/java/org/springframework/samples/petclinic/service/ClinicService.java @@ -3,11 +3,11 @@ package org.springframework.samples.petclinic.service; import java.util.Collection; import org.springframework.dao.DataAccessException; -import org.springframework.samples.petclinic.Owner; -import org.springframework.samples.petclinic.Pet; -import org.springframework.samples.petclinic.PetType; -import org.springframework.samples.petclinic.Vet; -import org.springframework.samples.petclinic.Visit; +import org.springframework.samples.petclinic.model.Owner; +import org.springframework.samples.petclinic.model.Pet; +import org.springframework.samples.petclinic.model.PetType; +import org.springframework.samples.petclinic.model.Vet; +import org.springframework.samples.petclinic.model.Visit; /** diff --git a/src/main/java/org/springframework/samples/petclinic/service/ClinicServiceImpl.java b/src/main/java/org/springframework/samples/petclinic/service/ClinicServiceImpl.java index 5ab0fba..3cee859 100644 --- a/src/main/java/org/springframework/samples/petclinic/service/ClinicServiceImpl.java +++ b/src/main/java/org/springframework/samples/petclinic/service/ClinicServiceImpl.java @@ -4,11 +4,11 @@ import java.util.Collection; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.DataAccessException; -import org.springframework.samples.petclinic.Owner; -import org.springframework.samples.petclinic.Pet; -import org.springframework.samples.petclinic.PetType; -import org.springframework.samples.petclinic.Vet; -import org.springframework.samples.petclinic.Visit; +import org.springframework.samples.petclinic.model.Owner; +import org.springframework.samples.petclinic.model.Pet; +import org.springframework.samples.petclinic.model.PetType; +import org.springframework.samples.petclinic.model.Vet; +import org.springframework.samples.petclinic.model.Visit; import org.springframework.samples.petclinic.repository.OwnerRepository; import org.springframework.samples.petclinic.repository.PetRepository; import org.springframework.samples.petclinic.repository.VetRepository; diff --git a/src/main/java/org/springframework/samples/petclinic/util/EntityUtils.java b/src/main/java/org/springframework/samples/petclinic/util/EntityUtils.java index 16df5fa..8a1cd29 100644 --- a/src/main/java/org/springframework/samples/petclinic/util/EntityUtils.java +++ b/src/main/java/org/springframework/samples/petclinic/util/EntityUtils.java @@ -4,7 +4,7 @@ package org.springframework.samples.petclinic.util; import java.util.Collection; import org.springframework.orm.ObjectRetrievalFailureException; -import org.springframework.samples.petclinic.BaseEntity; +import org.springframework.samples.petclinic.model.BaseEntity; /** * Utility methods for handling entities. Separate from the BaseEntity class @@ -14,7 +14,7 @@ import org.springframework.samples.petclinic.BaseEntity; * @author Juergen Hoeller * @author Sam Brannen * @since 29.10.2003 - * @see org.springframework.samples.petclinic.BaseEntity + * @see org.springframework.samples.petclinic.model.BaseEntity */ public abstract class EntityUtils { diff --git a/src/main/java/org/springframework/samples/petclinic/web/OwnerController.java b/src/main/java/org/springframework/samples/petclinic/web/OwnerController.java index ac2f9ca..6edafdd 100644 --- a/src/main/java/org/springframework/samples/petclinic/web/OwnerController.java +++ b/src/main/java/org/springframework/samples/petclinic/web/OwnerController.java @@ -20,7 +20,7 @@ import java.util.Collection; import javax.validation.Valid; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.samples.petclinic.Owner; +import org.springframework.samples.petclinic.model.Owner; import org.springframework.samples.petclinic.service.ClinicService; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; diff --git a/src/main/java/org/springframework/samples/petclinic/web/PetController.java b/src/main/java/org/springframework/samples/petclinic/web/PetController.java index b30a302..2c0c0b7 100644 --- a/src/main/java/org/springframework/samples/petclinic/web/PetController.java +++ b/src/main/java/org/springframework/samples/petclinic/web/PetController.java @@ -18,9 +18,9 @@ package org.springframework.samples.petclinic.web; import java.util.Collection; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.samples.petclinic.Owner; -import org.springframework.samples.petclinic.Pet; -import org.springframework.samples.petclinic.PetType; +import org.springframework.samples.petclinic.model.Owner; +import org.springframework.samples.petclinic.model.Pet; +import org.springframework.samples.petclinic.model.PetType; import org.springframework.samples.petclinic.service.ClinicService; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; diff --git a/src/main/java/org/springframework/samples/petclinic/web/PetTypeFormatter.java b/src/main/java/org/springframework/samples/petclinic/web/PetTypeFormatter.java index 46b3109..00ee845 100644 --- a/src/main/java/org/springframework/samples/petclinic/web/PetTypeFormatter.java +++ b/src/main/java/org/springframework/samples/petclinic/web/PetTypeFormatter.java @@ -22,7 +22,7 @@ import java.util.Locale; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.format.Formatter; -import org.springframework.samples.petclinic.PetType; +import org.springframework.samples.petclinic.model.PetType; import org.springframework.samples.petclinic.service.ClinicService; /** diff --git a/src/main/java/org/springframework/samples/petclinic/web/PetValidator.java b/src/main/java/org/springframework/samples/petclinic/web/PetValidator.java index 0ff5342..fbf080e 100644 --- a/src/main/java/org/springframework/samples/petclinic/web/PetValidator.java +++ b/src/main/java/org/springframework/samples/petclinic/web/PetValidator.java @@ -15,7 +15,7 @@ */ package org.springframework.samples.petclinic.web; -import org.springframework.samples.petclinic.Pet; +import org.springframework.samples.petclinic.model.Pet; import org.springframework.util.StringUtils; import org.springframework.validation.Errors; diff --git a/src/main/java/org/springframework/samples/petclinic/web/VetController.java b/src/main/java/org/springframework/samples/petclinic/web/VetController.java index 691f674..dfbc216 100644 --- a/src/main/java/org/springframework/samples/petclinic/web/VetController.java +++ b/src/main/java/org/springframework/samples/petclinic/web/VetController.java @@ -16,7 +16,7 @@ package org.springframework.samples.petclinic.web; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.samples.petclinic.Vets; +import org.springframework.samples.petclinic.model.Vets; import org.springframework.samples.petclinic.service.ClinicService; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; diff --git a/src/main/java/org/springframework/samples/petclinic/web/VisitController.java b/src/main/java/org/springframework/samples/petclinic/web/VisitController.java index 0a7ef22..b72e0ca 100644 --- a/src/main/java/org/springframework/samples/petclinic/web/VisitController.java +++ b/src/main/java/org/springframework/samples/petclinic/web/VisitController.java @@ -18,8 +18,8 @@ package org.springframework.samples.petclinic.web; import javax.validation.Valid; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.samples.petclinic.Pet; -import org.springframework.samples.petclinic.Visit; +import org.springframework.samples.petclinic.model.Pet; +import org.springframework.samples.petclinic.model.Visit; import org.springframework.samples.petclinic.service.ClinicService; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; diff --git a/src/main/java/org/springframework/samples/petclinic/web/VisitsAtomView.java b/src/main/java/org/springframework/samples/petclinic/web/VisitsAtomView.java index e3a72e2..089d104 100644 --- a/src/main/java/org/springframework/samples/petclinic/web/VisitsAtomView.java +++ b/src/main/java/org/springframework/samples/petclinic/web/VisitsAtomView.java @@ -23,7 +23,7 @@ import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.springframework.samples.petclinic.Visit; +import org.springframework.samples.petclinic.model.Visit; import org.springframework.web.servlet.view.feed.AbstractAtomFeedView; import com.sun.syndication.feed.atom.Content; diff --git a/src/main/resources/META-INF/aop.xml b/src/main/resources/META-INF/aop.xml index b49ffd8..46c806f 100644 --- a/src/main/resources/META-INF/aop.xml +++ b/src/main/resources/META-INF/aop.xml @@ -4,13 +4,13 @@ - + - - + + diff --git a/src/main/resources/spring/jdbc.properties b/src/main/resources/spring/jdbc.properties index 5d6b558..a199c64 100644 --- a/src/main/resources/spring/jdbc.properties +++ b/src/main/resources/spring/jdbc.properties @@ -30,7 +30,7 @@ jdbc.dataLocation=classpath:db/hsqldb/populateDB.sql hibernate.dialect=org.hibernate.dialect.HSQLDialect # Property that determines which JPA DatabasePlatform to use with TopLink Essentials -jpa.databasePlatform=org.springframework.samples.petclinic.toplink.EssentialsHSQLPlatformWithNativeSequence +jpa.databasePlatform=org.springframework.samples.petclinic.model.toplink.EssentialsHSQLPlatformWithNativeSequence # Property that determines which database to use with an AbstractJpaVendorAdapter jpa.database=HSQL diff --git a/src/main/webapp/WEB-INF/mvc-view-config.xml b/src/main/webapp/WEB-INF/mvc-view-config.xml index 0487164..51ac734 100644 --- a/src/main/webapp/WEB-INF/mvc-view-config.xml +++ b/src/main/webapp/WEB-INF/mvc-view-config.xml @@ -57,7 +57,7 @@ - + diff --git a/src/test/java/org/springframework/samples/petclinic/AbstractOwnerRepositoryTests.java b/src/test/java/org/springframework/samples/petclinic/AbstractOwnerRepositoryTests.java index a2d0e79..c3e4c65 100644 --- a/src/test/java/org/springframework/samples/petclinic/AbstractOwnerRepositoryTests.java +++ b/src/test/java/org/springframework/samples/petclinic/AbstractOwnerRepositoryTests.java @@ -7,6 +7,7 @@ import java.util.Collection; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.samples.petclinic.model.Owner; import org.springframework.samples.petclinic.repository.OwnerRepository; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests; diff --git a/src/test/java/org/springframework/samples/petclinic/AbstractPetRepositoryTests.java b/src/test/java/org/springframework/samples/petclinic/AbstractPetRepositoryTests.java index d097ea3..c9920d5 100644 --- a/src/test/java/org/springframework/samples/petclinic/AbstractPetRepositoryTests.java +++ b/src/test/java/org/springframework/samples/petclinic/AbstractPetRepositoryTests.java @@ -8,6 +8,9 @@ import java.util.Collection; import org.joda.time.DateTime; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.samples.petclinic.model.Owner; +import org.springframework.samples.petclinic.model.Pet; +import org.springframework.samples.petclinic.model.PetType; import org.springframework.samples.petclinic.repository.OwnerRepository; import org.springframework.samples.petclinic.repository.PetRepository; import org.springframework.samples.petclinic.service.ClinicService; diff --git a/src/test/java/org/springframework/samples/petclinic/AbstractVetRepositoryTests.java b/src/test/java/org/springframework/samples/petclinic/AbstractVetRepositoryTests.java index 205849a..0269aa7 100644 --- a/src/test/java/org/springframework/samples/petclinic/AbstractVetRepositoryTests.java +++ b/src/test/java/org/springframework/samples/petclinic/AbstractVetRepositoryTests.java @@ -6,6 +6,7 @@ import java.util.Collection; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.samples.petclinic.model.Vet; import org.springframework.samples.petclinic.repository.VetRepository; import org.springframework.samples.petclinic.service.ClinicService; import org.springframework.samples.petclinic.util.EntityUtils; diff --git a/src/test/java/org/springframework/samples/petclinic/AbstractVisitRepositoryTests.java b/src/test/java/org/springframework/samples/petclinic/AbstractVisitRepositoryTests.java index ecdc243..1f769b8 100644 --- a/src/test/java/org/springframework/samples/petclinic/AbstractVisitRepositoryTests.java +++ b/src/test/java/org/springframework/samples/petclinic/AbstractVisitRepositoryTests.java @@ -4,6 +4,8 @@ import static org.junit.Assert.assertEquals; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.samples.petclinic.model.Pet; +import org.springframework.samples.petclinic.model.Visit; import org.springframework.samples.petclinic.repository.PetRepository; import org.springframework.samples.petclinic.repository.VisitRepository; import org.springframework.samples.petclinic.service.ClinicService; diff --git a/src/test/java/org/springframework/samples/petclinic/OwnerTests.java b/src/test/java/org/springframework/samples/petclinic/OwnerTests.java index 84b5f62..5fc0d95 100644 --- a/src/test/java/org/springframework/samples/petclinic/OwnerTests.java +++ b/src/test/java/org/springframework/samples/petclinic/OwnerTests.java @@ -4,6 +4,8 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import org.junit.Test; +import org.springframework.samples.petclinic.model.Owner; +import org.springframework.samples.petclinic.model.Pet; /** * JUnit test for the {@link Owner} class. diff --git a/src/test/java/org/springframework/samples/petclinic/web/VisitsAtomViewTest.java b/src/test/java/org/springframework/samples/petclinic/web/VisitsAtomViewTest.java index e0cc8e6..6c79082 100644 --- a/src/test/java/org/springframework/samples/petclinic/web/VisitsAtomViewTest.java +++ b/src/test/java/org/springframework/samples/petclinic/web/VisitsAtomViewTest.java @@ -27,9 +27,9 @@ import java.util.Map; import org.joda.time.DateTime; import org.junit.Before; import org.junit.Test; -import org.springframework.samples.petclinic.Pet; -import org.springframework.samples.petclinic.PetType; -import org.springframework.samples.petclinic.Visit; +import org.springframework.samples.petclinic.model.Pet; +import org.springframework.samples.petclinic.model.PetType; +import org.springframework.samples.petclinic.model.Visit; import com.sun.syndication.feed.atom.Entry; import com.sun.syndication.feed.atom.Feed;