From 875ee9bb987e4da055352a028d950aa0a5e049ba Mon Sep 17 00:00:00 2001 From: sdelamo Date: Mon, 31 Jul 2017 12:58:07 +0200 Subject: [PATCH] remove GORM-without-Grails package --- .../service/MakeService.groovy | 7 ----- .../service/ModelService.groovy | 7 ----- .../service/VehicleService.groovy | 7 ----- .../GormWithoutGrailsApplication.groovy | 2 +- .../controller/MakeController.groovy | 4 +-- .../controller/ModelController.groovy | 4 +-- .../controller/VehicleController.groovy | 4 +-- .../domain/Driver.groovy | 2 +- .../domain/Make.groovy | 2 +- .../domain/Model.groovy | 2 +- .../domain/User.groovy | 2 +- .../domain/Vehicle.groovy | 2 +- .../groovy/demo/service/MakeService.groovy | 7 +++++ .../service/MakeServiceImpl.groovy | 4 +-- .../groovy/demo/service/ModelService.groovy | 7 +++++ .../service/ModelServiceImpl.groovy | 5 ++-- .../groovy/demo/service/VehicleService.groovy | 7 +++++ .../service/VehicleServiceImpl.groovy | 4 +-- .../domain/DriverSpec.groovy | 11 +++++--- .../GORMwithoutGrails/domain/MakeSpec.groovy | 3 +- .../GORMwithoutGrails/domain/ModelSpec.groovy | 3 +- .../domain/VehicleSpec.groovy | 5 +++- .../GormWithoutGrailsApplication.groovy | 2 +- .../GormWithoutGrailsApplicationTests.groovy | 2 +- .../docs/guide/creatingTheControllers.adoc | 16 +++++------ src/main/docs/guide/creatingTheDomain.adoc | 24 ++++++++-------- src/main/docs/guide/creatingTheServices.adoc | 28 +++++++++---------- src/main/docs/guide/howto.adoc | 11 ++++---- src/main/docs/guide/testingTheDomain.adoc | 16 +++++------ 29 files changed, 104 insertions(+), 96 deletions(-) delete mode 100644 complete/src/main/groovy/demo/GORMwithoutGrails/service/MakeService.groovy delete mode 100644 complete/src/main/groovy/demo/GORMwithoutGrails/service/ModelService.groovy delete mode 100644 complete/src/main/groovy/demo/GORMwithoutGrails/service/VehicleService.groovy rename complete/src/main/groovy/demo/{GORMwithoutGrails => }/GormWithoutGrailsApplication.groovy (92%) rename complete/src/main/groovy/demo/{GORMwithoutGrails => }/controller/MakeController.groovy (80%) rename complete/src/main/groovy/demo/{GORMwithoutGrails => }/controller/ModelController.groovy (80%) rename complete/src/main/groovy/demo/{GORMwithoutGrails => }/controller/VehicleController.groovy (80%) rename complete/src/main/groovy/demo/{GORMwithoutGrails => }/domain/Driver.groovy (89%) rename complete/src/main/groovy/demo/{GORMwithoutGrails => }/domain/Make.groovy (88%) rename complete/src/main/groovy/demo/{GORMwithoutGrails => }/domain/Model.groovy (89%) rename complete/src/main/groovy/demo/{GORMwithoutGrails => }/domain/User.groovy (95%) rename complete/src/main/groovy/demo/{GORMwithoutGrails => }/domain/Vehicle.groovy (90%) create mode 100644 complete/src/main/groovy/demo/service/MakeService.groovy rename complete/src/main/groovy/demo/{GORMwithoutGrails => }/service/MakeServiceImpl.groovy (78%) create mode 100644 complete/src/main/groovy/demo/service/ModelService.groovy rename complete/src/main/groovy/demo/{GORMwithoutGrails => }/service/ModelServiceImpl.groovy (78%) create mode 100644 complete/src/main/groovy/demo/service/VehicleService.groovy rename complete/src/main/groovy/demo/{GORMwithoutGrails => }/service/VehicleServiceImpl.groovy (79%) diff --git a/complete/src/main/groovy/demo/GORMwithoutGrails/service/MakeService.groovy b/complete/src/main/groovy/demo/GORMwithoutGrails/service/MakeService.groovy deleted file mode 100644 index c9c7c7a..0000000 --- a/complete/src/main/groovy/demo/GORMwithoutGrails/service/MakeService.groovy +++ /dev/null @@ -1,7 +0,0 @@ -package demo.GORMwithoutGrails.service - -import demo.GORMwithoutGrails.domain.Make - -interface MakeService { - List list() -} diff --git a/complete/src/main/groovy/demo/GORMwithoutGrails/service/ModelService.groovy b/complete/src/main/groovy/demo/GORMwithoutGrails/service/ModelService.groovy deleted file mode 100644 index 6d5c1a6..0000000 --- a/complete/src/main/groovy/demo/GORMwithoutGrails/service/ModelService.groovy +++ /dev/null @@ -1,7 +0,0 @@ -package demo.GORMwithoutGrails.service - -import demo.GORMwithoutGrails.domain.Model - -interface ModelService { - List list() -} diff --git a/complete/src/main/groovy/demo/GORMwithoutGrails/service/VehicleService.groovy b/complete/src/main/groovy/demo/GORMwithoutGrails/service/VehicleService.groovy deleted file mode 100644 index 38e85f4..0000000 --- a/complete/src/main/groovy/demo/GORMwithoutGrails/service/VehicleService.groovy +++ /dev/null @@ -1,7 +0,0 @@ -package demo.GORMwithoutGrails.service - -import demo.GORMwithoutGrails.domain.Vehicle - -interface VehicleService { - List list() -} diff --git a/complete/src/main/groovy/demo/GORMwithoutGrails/GormWithoutGrailsApplication.groovy b/complete/src/main/groovy/demo/GormWithoutGrailsApplication.groovy similarity index 92% rename from complete/src/main/groovy/demo/GORMwithoutGrails/GormWithoutGrailsApplication.groovy rename to complete/src/main/groovy/demo/GormWithoutGrailsApplication.groovy index 3e265ee..d0ef0f7 100644 --- a/complete/src/main/groovy/demo/GORMwithoutGrails/GormWithoutGrailsApplication.groovy +++ b/complete/src/main/groovy/demo/GormWithoutGrailsApplication.groovy @@ -1,4 +1,4 @@ -package demo.GORMwithoutGrails +package demo import org.springframework.boot.SpringApplication import org.springframework.boot.autoconfigure.SpringBootApplication diff --git a/complete/src/main/groovy/demo/GORMwithoutGrails/controller/MakeController.groovy b/complete/src/main/groovy/demo/controller/MakeController.groovy similarity index 80% rename from complete/src/main/groovy/demo/GORMwithoutGrails/controller/MakeController.groovy rename to complete/src/main/groovy/demo/controller/MakeController.groovy index ea05e8c..6c97a18 100644 --- a/complete/src/main/groovy/demo/GORMwithoutGrails/controller/MakeController.groovy +++ b/complete/src/main/groovy/demo/controller/MakeController.groovy @@ -1,6 +1,6 @@ -package demo.GORMwithoutGrails.controller +package demo.controller -import demo.GORMwithoutGrails.service.MakeService +import demo.service.MakeService import org.springframework.beans.factory.annotation.Autowired import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RestController diff --git a/complete/src/main/groovy/demo/GORMwithoutGrails/controller/ModelController.groovy b/complete/src/main/groovy/demo/controller/ModelController.groovy similarity index 80% rename from complete/src/main/groovy/demo/GORMwithoutGrails/controller/ModelController.groovy rename to complete/src/main/groovy/demo/controller/ModelController.groovy index 42bdcee..a68e815 100644 --- a/complete/src/main/groovy/demo/GORMwithoutGrails/controller/ModelController.groovy +++ b/complete/src/main/groovy/demo/controller/ModelController.groovy @@ -1,6 +1,6 @@ -package demo.GORMwithoutGrails.controller +package demo.controller -import demo.GORMwithoutGrails.service.ModelService +import demo.service.ModelService import org.springframework.beans.factory.annotation.Autowired import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RestController diff --git a/complete/src/main/groovy/demo/GORMwithoutGrails/controller/VehicleController.groovy b/complete/src/main/groovy/demo/controller/VehicleController.groovy similarity index 80% rename from complete/src/main/groovy/demo/GORMwithoutGrails/controller/VehicleController.groovy rename to complete/src/main/groovy/demo/controller/VehicleController.groovy index 883673d..e639599 100644 --- a/complete/src/main/groovy/demo/GORMwithoutGrails/controller/VehicleController.groovy +++ b/complete/src/main/groovy/demo/controller/VehicleController.groovy @@ -1,6 +1,6 @@ -package demo.GORMwithoutGrails.controller +package demo.controller -import demo.GORMwithoutGrails.service.VehicleService +import demo.service.VehicleService import org.springframework.beans.factory.annotation.Autowired import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RestController diff --git a/complete/src/main/groovy/demo/GORMwithoutGrails/domain/Driver.groovy b/complete/src/main/groovy/demo/domain/Driver.groovy similarity index 89% rename from complete/src/main/groovy/demo/GORMwithoutGrails/domain/Driver.groovy rename to complete/src/main/groovy/demo/domain/Driver.groovy index 3abc297..cff63af 100644 --- a/complete/src/main/groovy/demo/GORMwithoutGrails/domain/Driver.groovy +++ b/complete/src/main/groovy/demo/domain/Driver.groovy @@ -1,4 +1,4 @@ -package demo.GORMwithoutGrails.domain +package demo.domain import grails.gorm.annotation.Entity diff --git a/complete/src/main/groovy/demo/GORMwithoutGrails/domain/Make.groovy b/complete/src/main/groovy/demo/domain/Make.groovy similarity index 88% rename from complete/src/main/groovy/demo/GORMwithoutGrails/domain/Make.groovy rename to complete/src/main/groovy/demo/domain/Make.groovy index a1a965b..3180779 100644 --- a/complete/src/main/groovy/demo/GORMwithoutGrails/domain/Make.groovy +++ b/complete/src/main/groovy/demo/domain/Make.groovy @@ -1,4 +1,4 @@ -package demo.GORMwithoutGrails.domain +package demo.domain import grails.gorm.annotation.Entity import org.grails.datastore.gorm.GormEntity diff --git a/complete/src/main/groovy/demo/GORMwithoutGrails/domain/Model.groovy b/complete/src/main/groovy/demo/domain/Model.groovy similarity index 89% rename from complete/src/main/groovy/demo/GORMwithoutGrails/domain/Model.groovy rename to complete/src/main/groovy/demo/domain/Model.groovy index ea64646..9ca6f19 100644 --- a/complete/src/main/groovy/demo/GORMwithoutGrails/domain/Model.groovy +++ b/complete/src/main/groovy/demo/domain/Model.groovy @@ -1,4 +1,4 @@ -package demo.GORMwithoutGrails.domain +package demo.domain import grails.gorm.annotation.Entity import org.grails.datastore.gorm.GormEntity diff --git a/complete/src/main/groovy/demo/GORMwithoutGrails/domain/User.groovy b/complete/src/main/groovy/demo/domain/User.groovy similarity index 95% rename from complete/src/main/groovy/demo/GORMwithoutGrails/domain/User.groovy rename to complete/src/main/groovy/demo/domain/User.groovy index 0b58f2f..9e79de4 100644 --- a/complete/src/main/groovy/demo/GORMwithoutGrails/domain/User.groovy +++ b/complete/src/main/groovy/demo/domain/User.groovy @@ -1,4 +1,4 @@ -package demo.GORMwithoutGrails.domain +package demo.domain import groovy.transform.EqualsAndHashCode import groovy.transform.ToString diff --git a/complete/src/main/groovy/demo/GORMwithoutGrails/domain/Vehicle.groovy b/complete/src/main/groovy/demo/domain/Vehicle.groovy similarity index 90% rename from complete/src/main/groovy/demo/GORMwithoutGrails/domain/Vehicle.groovy rename to complete/src/main/groovy/demo/domain/Vehicle.groovy index 27c099d..63e902b 100644 --- a/complete/src/main/groovy/demo/GORMwithoutGrails/domain/Vehicle.groovy +++ b/complete/src/main/groovy/demo/domain/Vehicle.groovy @@ -1,4 +1,4 @@ -package demo.GORMwithoutGrails.domain +package demo.domain import grails.gorm.annotation.Entity import org.grails.datastore.gorm.GormEntity diff --git a/complete/src/main/groovy/demo/service/MakeService.groovy b/complete/src/main/groovy/demo/service/MakeService.groovy new file mode 100644 index 0000000..371e8cd --- /dev/null +++ b/complete/src/main/groovy/demo/service/MakeService.groovy @@ -0,0 +1,7 @@ +package demo.service + +import demo.domain.Make + +interface MakeService { + List list() +} diff --git a/complete/src/main/groovy/demo/GORMwithoutGrails/service/MakeServiceImpl.groovy b/complete/src/main/groovy/demo/service/MakeServiceImpl.groovy similarity index 78% rename from complete/src/main/groovy/demo/GORMwithoutGrails/service/MakeServiceImpl.groovy rename to complete/src/main/groovy/demo/service/MakeServiceImpl.groovy index 874f1a8..d5d9ba3 100644 --- a/complete/src/main/groovy/demo/GORMwithoutGrails/service/MakeServiceImpl.groovy +++ b/complete/src/main/groovy/demo/service/MakeServiceImpl.groovy @@ -1,6 +1,6 @@ -package demo.GORMwithoutGrails.service +package demo.service -import demo.GORMwithoutGrails.domain.Make +import demo.domain.Make import org.springframework.stereotype.Service import org.springframework.transaction.annotation.Transactional diff --git a/complete/src/main/groovy/demo/service/ModelService.groovy b/complete/src/main/groovy/demo/service/ModelService.groovy new file mode 100644 index 0000000..fa0e197 --- /dev/null +++ b/complete/src/main/groovy/demo/service/ModelService.groovy @@ -0,0 +1,7 @@ +package demo.service + +import demo.domain.Model + +interface ModelService { + List list() +} diff --git a/complete/src/main/groovy/demo/GORMwithoutGrails/service/ModelServiceImpl.groovy b/complete/src/main/groovy/demo/service/ModelServiceImpl.groovy similarity index 78% rename from complete/src/main/groovy/demo/GORMwithoutGrails/service/ModelServiceImpl.groovy rename to complete/src/main/groovy/demo/service/ModelServiceImpl.groovy index 853b62a..8f73f78 100644 --- a/complete/src/main/groovy/demo/GORMwithoutGrails/service/ModelServiceImpl.groovy +++ b/complete/src/main/groovy/demo/service/ModelServiceImpl.groovy @@ -1,6 +1,7 @@ -package demo.GORMwithoutGrails.service +package demo.service -import demo.GORMwithoutGrails.domain.Model +import demo.domain.Model +import demo.domain.Model import org.springframework.stereotype.Service import org.springframework.transaction.annotation.Transactional diff --git a/complete/src/main/groovy/demo/service/VehicleService.groovy b/complete/src/main/groovy/demo/service/VehicleService.groovy new file mode 100644 index 0000000..ea5ae0e --- /dev/null +++ b/complete/src/main/groovy/demo/service/VehicleService.groovy @@ -0,0 +1,7 @@ +package demo.service + +import demo.domain.Vehicle + +interface VehicleService { + List list() +} diff --git a/complete/src/main/groovy/demo/GORMwithoutGrails/service/VehicleServiceImpl.groovy b/complete/src/main/groovy/demo/service/VehicleServiceImpl.groovy similarity index 79% rename from complete/src/main/groovy/demo/GORMwithoutGrails/service/VehicleServiceImpl.groovy rename to complete/src/main/groovy/demo/service/VehicleServiceImpl.groovy index 3ecf832..3adb56a 100644 --- a/complete/src/main/groovy/demo/GORMwithoutGrails/service/VehicleServiceImpl.groovy +++ b/complete/src/main/groovy/demo/service/VehicleServiceImpl.groovy @@ -1,6 +1,6 @@ -package demo.GORMwithoutGrails.service +package demo.service -import demo.GORMwithoutGrails.domain.Vehicle +import demo.domain.Vehicle import org.springframework.stereotype.Service import org.springframework.transaction.annotation.Transactional diff --git a/complete/src/test/groovy/demo/GORMwithoutGrails/domain/DriverSpec.groovy b/complete/src/test/groovy/demo/GORMwithoutGrails/domain/DriverSpec.groovy index 6d0039b..cb054ec 100644 --- a/complete/src/test/groovy/demo/GORMwithoutGrails/domain/DriverSpec.groovy +++ b/complete/src/test/groovy/demo/GORMwithoutGrails/domain/DriverSpec.groovy @@ -1,14 +1,17 @@ -package demo.GORMwithoutGrails.domain +package demo.domain -import grails.gorm.transactions.Rollback +import demo.domain.Driver import org.grails.orm.hibernate.HibernateDatastore +import spock.lang.Specification +import grails.gorm.transactions.Rollback import spock.lang.AutoCleanup import spock.lang.Shared -import spock.lang.Specification + class DriverSpec extends Specification { - @Shared @AutoCleanup HibernateDatastore datastore = new HibernateDatastore(getClass().getPackage()) + @Shared @AutoCleanup + HibernateDatastore datastore = new HibernateDatastore(getClass().getPackage()) @Rollback def "Driver created with name"() { diff --git a/complete/src/test/groovy/demo/GORMwithoutGrails/domain/MakeSpec.groovy b/complete/src/test/groovy/demo/GORMwithoutGrails/domain/MakeSpec.groovy index 173a86f..b82de2e 100644 --- a/complete/src/test/groovy/demo/GORMwithoutGrails/domain/MakeSpec.groovy +++ b/complete/src/test/groovy/demo/GORMwithoutGrails/domain/MakeSpec.groovy @@ -1,5 +1,6 @@ -package demo.GORMwithoutGrails.domain +package demo.domain +import demo.domain.Make import grails.gorm.transactions.Rollback import org.grails.orm.hibernate.HibernateDatastore import spock.lang.AutoCleanup diff --git a/complete/src/test/groovy/demo/GORMwithoutGrails/domain/ModelSpec.groovy b/complete/src/test/groovy/demo/GORMwithoutGrails/domain/ModelSpec.groovy index 868e51b..ef203c7 100644 --- a/complete/src/test/groovy/demo/GORMwithoutGrails/domain/ModelSpec.groovy +++ b/complete/src/test/groovy/demo/GORMwithoutGrails/domain/ModelSpec.groovy @@ -1,5 +1,6 @@ -package demo.GORMwithoutGrails.domain +package demo.domain +import demo.domain.Model import grails.gorm.transactions.Rollback import org.grails.orm.hibernate.HibernateDatastore import spock.lang.AutoCleanup diff --git a/complete/src/test/groovy/demo/GORMwithoutGrails/domain/VehicleSpec.groovy b/complete/src/test/groovy/demo/GORMwithoutGrails/domain/VehicleSpec.groovy index 6e47ea8..2f3d6d0 100644 --- a/complete/src/test/groovy/demo/GORMwithoutGrails/domain/VehicleSpec.groovy +++ b/complete/src/test/groovy/demo/GORMwithoutGrails/domain/VehicleSpec.groovy @@ -1,5 +1,8 @@ -package demo.GORMwithoutGrails.domain +package demo.domain +import demo.domain.Make +import demo.domain.Model +import demo.domain.Vehicle import grails.gorm.transactions.Rollback import org.grails.orm.hibernate.HibernateDatastore import spock.lang.AutoCleanup diff --git a/initial/src/main/groovy/demo/GORMwithoutGrails/GormWithoutGrailsApplication.groovy b/initial/src/main/groovy/demo/GORMwithoutGrails/GormWithoutGrailsApplication.groovy index e9fe6a4..26c235e 100644 --- a/initial/src/main/groovy/demo/GORMwithoutGrails/GormWithoutGrailsApplication.groovy +++ b/initial/src/main/groovy/demo/GORMwithoutGrails/GormWithoutGrailsApplication.groovy @@ -1,4 +1,4 @@ -package demo.GORMwithoutGrails +package demo import org.springframework.boot.SpringApplication import org.springframework.boot.autoconfigure.SpringBootApplication diff --git a/initial/src/test/groovy/demo/GORMwithoutGrails/GormWithoutGrailsApplicationTests.groovy b/initial/src/test/groovy/demo/GORMwithoutGrails/GormWithoutGrailsApplicationTests.groovy index 3a1933d..45b0314 100644 --- a/initial/src/test/groovy/demo/GORMwithoutGrails/GormWithoutGrailsApplicationTests.groovy +++ b/initial/src/test/groovy/demo/GORMwithoutGrails/GormWithoutGrailsApplicationTests.groovy @@ -1,4 +1,4 @@ -package demo.GORMwithoutGrails +package demo import org.junit.Test import org.junit.runner.RunWith diff --git a/src/main/docs/guide/creatingTheControllers.adoc b/src/main/docs/guide/creatingTheControllers.adoc index adf1d9b..c3de962 100644 --- a/src/main/docs/guide/creatingTheControllers.adoc +++ b/src/main/docs/guide/creatingTheControllers.adoc @@ -2,13 +2,13 @@ Finally lets create some controllers so we can have basic UI access to our data. [source,bash] ---- - $ cd src/main/groovy/demo/GORMwithoutGrails/controller + $ cd src/main/groovy/demo/controller $ touch MakeController $ touch ModelController $ touch VehicleController ---- -Now let’s edit our controllers under src/main/groovy/demo/GORMwithoutGrails/controller. +Now let’s edit our controllers under src/main/groovy/demo/controller. We will import one of our services and update our index method. The controllers will have the following annotations @@ -18,21 +18,21 @@ the following annotations - @RequestMapping("/") [on the method] - Sets the url mapping for the method, beyond the base url [source,groovy] -./src/main/groovy/demo/GORMwithoutGrails/controller/MakeController.groovy +./src/main/groovy/demo/controller/MakeController.groovy ---- -include::{sourceDir}/src/main/groovy/demo/GORMwithoutGrails/controller/MakeController.groovy[] +include::{sourceDir}/src/main/groovy/demo/controller/MakeController.groovy[] ---- [source,groovy] -./src/main/groovy/demo/GORMwithoutGrails/controller/ModelController.groovy +./src/main/groovy/demo/controller/ModelController.groovy ---- -include::{sourceDir}/src/main/groovy/demo/GORMwithoutGrails/controller/ModelController.groovy[] +include::{sourceDir}/src/main/groovy/demo/controller/ModelController.groovy[] ---- [source,groovy] -./src/main/groovy/demo/GORMwithoutGrails/controller/VehicleController.groovy +./src/main/groovy/demo/controller/VehicleController.groovy ---- -include::{sourceDir}/src/main/groovy/demo/GORMwithoutGrails/controller/VehicleController.groovy[] +include::{sourceDir}/src/main/groovy/demo/controller/VehicleController.groovy[] ---- Now that we have controllers with url mappings we have everything we need to test our diff --git a/src/main/docs/guide/creatingTheDomain.adoc b/src/main/docs/guide/creatingTheDomain.adoc index 84ecd1f..73914de 100644 --- a/src/main/docs/guide/creatingTheDomain.adoc +++ b/src/main/docs/guide/creatingTheDomain.adoc @@ -12,7 +12,7 @@ Feel free to use your favorite IDE to create these or execute the following [source,bash] ---- -$ cd complete/src/main/groovy/demo/GORMwithoutGrails/domain/ +$ cd complete/src/main/groovy/demo/domain/ $ touch Driver.groovy $ touch Make.groovy $ touch Model.groovy @@ -24,7 +24,7 @@ Next lets do the same thing to setup our testing files. [source,bash] ---- -$ cd complete/src/test/groovy/demo/GORMwithoutGrails/domain/ +$ cd complete/src/test/groovy/demo/domain/ $ touch DriverSpec.groovy $ touch MakeSpec.groovy $ touch ModelSpec.groovy @@ -34,21 +34,21 @@ $ touch VehicleSpec.groovy Now that all our class stubs are in place lets go ahead and edit them. [source,groovy] -./src/main/groovy/demo/GORMwithoutGrails/domain/Make.groovy +./src/main/groovy/demo/domain/Make.groovy ---- -include::{sourceDir}/src/main/groovy/demo/GORMwithoutGrails/domain/Make.groovy[] +include::{sourceDir}/src/main/groovy/demo/domain/Make.groovy[] ---- [source,groovy] -./src/main/groovy/demo/GORMwithoutGrails/domain/Model.groovy +./src/main/groovy/demo/domain/Model.groovy ---- -include::{sourceDir}/src/main/groovy/demo/GORMwithoutGrails/domain/Model.groovy[] +include::{sourceDir}/src/main/groovy/demo/domain/Model.groovy[] ---- [source,groovy] -./src/main/groovy/demo/GORMwithoutGrails/domain/Vehicle.groovy +./src/main/groovy/demo/domain/Vehicle.groovy ---- -include::{sourceDir}/src/main/groovy/demo/GORMwithoutGrails/domain/Vehicle.groovy[] +include::{sourceDir}/src/main/groovy/demo/domain/Vehicle.groovy[] ---- There is a bit more to our `Driver.groovy` than meets the eye versus the first 3 classes. That's @@ -56,15 +56,15 @@ because we are actually extending our `User.groovy class with driver. This will some extra flexibility in the future as we grow our application. [source,groovy] -./src/main/groovy/demo/GORMwithoutGrails/domain/Driver.groovy +./src/main/groovy/demo/domain/Driver.groovy ---- -include::{sourceDir}/src/main/groovy/demo/GORMwithoutGrails/domain/Driver.groovy[] +include::{sourceDir}/src/main/groovy/demo/domain/Driver.groovy[] ---- [source,groovy] -./src/main/groovy/demo/GORMwithoutGrails/domain/User.groovy +./src/main/groovy/demo/domain/User.groovy ---- -include::{sourceDir}/src/main/groovy/demo/GORMwithoutGrails/domain/User.groovy[] +include::{sourceDir}/src/main/groovy/demo/domain/User.groovy[] ---- Unlike standard GORM we annotate our domain classes with the `@Entity` annotation so that diff --git a/src/main/docs/guide/creatingTheServices.adoc b/src/main/docs/guide/creatingTheServices.adoc index b32c181..72f6e39 100644 --- a/src/main/docs/guide/creatingTheServices.adoc +++ b/src/main/docs/guide/creatingTheServices.adoc @@ -2,7 +2,7 @@ Next lets create our service layer for our application. [source,bash] ---- - $ cd src/main/groovy/demo/GORMwithoutGrails/service + $ cd src/main/groovy/demo/service $ touch MakeService $ touch MakeServiceImpl $ touch ModelService @@ -11,45 +11,45 @@ Next lets create our service layer for our application. $ touch VehicleServiceImpl ---- -Now let’s edit our service classes under src/main/groovy/demo/GORMwithoutGrails/service. +Now let’s edit our service classes under src/main/groovy/demo/service. We’ll add a `list()` method to all of the classes. This method will have the following additional annotation. - @Transactional(readOnly = true) - good practice to have on methods that only return data [source,groovy] -./src/main/groovy/demo/GORMwithoutGrails/service/MakeService.groovy +./src/main/groovy/demo/service/MakeService.groovy ---- -include::{sourceDir}/src/main/groovy/demo/GORMwithoutGrails/service/MakeService.groovy[] +include::{sourceDir}/src/main/groovy/demo/service/MakeService.groovy[] ---- [source,groovy] -./src/main/groovy/demo/GORMwithoutGrails/service/MakeServiceImpl.groovy +./src/main/groovy/demo/service/MakeServiceImpl.groovy ---- -include::{sourceDir}/src/main/groovy/demo/GORMwithoutGrails/service/MakeServiceImpl.groovy[] +include::{sourceDir}/src/main/groovy/demo/service/MakeServiceImpl.groovy[] ---- [source,groovy] -./src/main/groovy/demo/GORMwithoutGrails/service/ModelService.groovy +./src/main/groovy/demo/service/ModelService.groovy ---- -include::{sourceDir}/src/main/groovy/demo/GORMwithoutGrails/service/ModelService.groovy[] +include::{sourceDir}/src/main/groovy/demo/service/ModelService.groovy[] ---- [source,groovy] -./src/main/groovy/demo/GORMwithoutGrails/service/ModelServiceImpl.groovy +./src/main/groovy/demo/service/ModelServiceImpl.groovy ---- -include::{sourceDir}/src/main/groovy/demo/GORMwithoutGrails/service/ModelServiceImpl.groovy[] +include::{sourceDir}/src/main/groovy/demo/service/ModelServiceImpl.groovy[] ---- [source,groovy] -./src/main/groovy/demo/GORMwithoutGrails/service/VehicleService.groovy +./src/main/groovy/demo/service/VehicleService.groovy ---- -include::{sourceDir}/src/main/groovy/demo/GORMwithoutGrails/service/VehicleService.groovy[] +include::{sourceDir}/src/main/groovy/demo/service/VehicleService.groovy[] ---- [source,groovy] -./src/main/groovy/demo/GORMwithoutGrails/service/VehicleServiceImpl.groovy +./src/main/groovy/demo/service/VehicleServiceImpl.groovy ---- -include::{sourceDir}/src/main/groovy/demo/GORMwithoutGrails/service/VehicleServiceImpl.groovy[] +include::{sourceDir}/src/main/groovy/demo/service/VehicleServiceImpl.groovy[] ---- Additionally all our service classes make use of the `@Service('someName')` annotation. diff --git a/src/main/docs/guide/howto.adoc b/src/main/docs/guide/howto.adoc index d93ccf4..e35e81d 100644 --- a/src/main/docs/guide/howto.adoc +++ b/src/main/docs/guide/howto.adoc @@ -3,18 +3,17 @@ include::{commondir}/common-howto.adoc[] If you want to start from scratch, create a new Spring Boot application using https://start.spring.io/[Spring Initializr]. -image::springInitial.png[] - -Select a `Gradle Project` using `Groovy` with `Spring Boot 1.5.4`. Once you have selected +Select a `Gradle Project` using `Groovy` with `Spring Boot 1.5.6`. Once you have selected your build and project type, set the Group to your organization ie. `com.example` in our case we will use `demo`. Next set the project name (whatever you like) in our case we have selected -`GORM-without-Grails` +`gorm-without-grails` + +Once that is done add the `Web` and `h2` dependencies to the project. image::buildAndMetadata.png[] -Once that is done add the `Web` and `h2` dependencies to the project. image::dependency1.png[] image::dependency2.png[] -Click `Generate Project`. \ No newline at end of file +Click `Generate Project`. diff --git a/src/main/docs/guide/testingTheDomain.adoc b/src/main/docs/guide/testingTheDomain.adoc index 6275bff..6f64805 100644 --- a/src/main/docs/guide/testingTheDomain.adoc +++ b/src/main/docs/guide/testingTheDomain.adoc @@ -3,27 +3,27 @@ successfully run a Spring Boot application with GORM. Lets go ahead and edit our files we created earlier and make use of those extra Spock dependencies that we included. [source,groovy] -./src/test/groovy/demo/GORMwithoutGrails/domain/MakeSpec.groovy +./src/test/groovy/demo/domain/MakeSpec.groovy ---- -include::{sourceDir}/src/test/groovy/demo/GORMwithoutGrails/domain/MakeSpec.groovy[] +include::{sourceDir}/src/test/groovy/demo/domain/MakeSpec.groovy[] ---- [source,groovy] -./src/test/groovy/demo/GORMwithoutGrails/domain/ModelSpec.groovy +./src/test/groovy/demo/domain/ModelSpec.groovy ---- -include::{sourceDir}/src/test/groovy/demo/GORMwithoutGrails/domain/ModelSpec.groovy[] +include::{sourceDir}/src/test/groovy/demo/domain/ModelSpec.groovy[] ---- [source,groovy] -./src/test/groovy/demo/GORMwithoutGrails/domain/DriverSpec.groovy +./src/test/groovy/demo/domain/DriverSpec.groovy ---- -include::{sourceDir}/src/test/groovy/demo/GORMwithoutGrails/domain/DriverSpec.groovy[] +include::{sourceDir}/src/test/groovy/demo/domain/DriverSpec.groovy[] ---- [source,groovy] -./src/test/groovy/demo/GORMwithoutGrails/domain/VehicleSpec.groovy +./src/test/groovy/demo/domain/VehicleSpec.groovy ---- -include::{sourceDir}/src/test/groovy/demo/GORMwithoutGrails/domain/VehicleSpec.groovy[] +include::{sourceDir}/src/test/groovy/demo/domain/VehicleSpec.groovy[] ---- All our tests are virtually identical sans we are testing different objects.