Añadir nuevos servicios
Introducción
En esta parte de la aplicación añadiremos nuevas tablas, DAO, servicios y controladores para nuestra aplicación de recursos humanos. Permitiremos gestionar ofertas de trabajo y añadir a ellas a los diferentes candidatos.
Creación de las tablas en la BD
Crearemos las tablas en la BD necesarias para esta nueva funcionalidad:
Código SQL
Añadimos las claves foráneas:
Código SQL
Rellenaremos las tablas con un mínimo de datos:
Código SQL
Creación de los DAO
Crearemos los DAO asociados a las tablas recién añadidas a la BD.
OfferCandidatesDao.xml
OfferCandidateStatusDao.xml
OfferDao.xml
OfferStatusDao.xml
OfferCandidatesDao.java
OfferCandidateStatusDao.java
OfferDao.java
OfferStatusDao.java
- hr
- hr-api
- src
- main
- java
- com
- ontimize
- hr
- api
- core
- service
- ICandidateService.java
- IMasterService.java
- IUserService.java
- service
- core
- api
- hr
- ontimize
- com
- java
- main
- pom.xml
- src
- hr-boot
- src
- main
- java
- com
- ontimize
- hr
- ServerApplication.java
- hr
- ontimize
- com
- resources
- application.yml
- java
- main
- pom.xml
- src
- hr-model
- src
- main
- db
- templateDB.script
- templateDB.txt
- java
- com
- ontimize
- hr
- model
- core
- dao
- CandidateDao.java
- EducationDao.java
- ExperienceLevelDao.java
- OfferCandidatesDao.java
- OfferCandidateStatusDao.java
- OfferDao.java
- OfferStatusDao.java
- OriginDao.java
- ProfileDao.java
- StatusDao.java
- UserDao.java
- UserRoleDao.java
- service
- CandidateService.java
- MasterService.java
- UserService.java
- dao
- core
- model
- hr
- ontimize
- com
- resources
- dao
- CandidateDao.xml
- EducationDao.xml
- ExperienceLevelDao.xml
- OfferCandidatesDao.xml
- OfferCandidateStatusDao.xml
- OfferDao.xml
- OfferStatusDao.xml
- OriginDao.xml
- placeholders.properties
- ProfileDao.xml
- RoleDao.xml
- RoleServerPermissionDao.xml
- ServerPermissionDao.xml
- StatusDao.xml
- UserDao.xml
- UserRoleDao.xml
- dao
- db
- main
- pom.xml
- src
- hr-ws
- src
- main
- java
- com
- ontimize
- hr
- ws
- core
- rest
- CandidateRestController.java
- MainRestController.java
- MasterRestController.java
- TestRestController.java
- UserRestController.java
- rest
- core
- ws
- hr
- ontimize
- com
- java
- main
- pom.xml
- src
- .gitignore
- Archetype_ontimize_boot.postman_collection.json
- pom.xml
- hr-api
Creación de la interfaz del servicio
Creamos la interfaz del servicio de ofertas para el cual hemos creado los DAO.
IOfferService.java
- hr
- hr-api
- src
- main
- java
- com
- ontimize
- hr
- api
- core
- service
- ICandidateService.java
- IMasterService.java
- IOfferService.java
- IUserService.java
- service
- core
- api
- hr
- ontimize
- com
- java
- main
- pom.xml
- src
- hr-boot
- src
- main
- java
- com
- ontimize
- hr
- ServerApplication.java
- hr
- ontimize
- com
- resources
- application.yml
- java
- main
- pom.xml
- src
- hr-model
- src
- main
- db
- templateDB.script
- templateDB.txt
- java
- com
- ontimize
- hr
- model
- core
- dao
- CandidateDao.java
- EducationDao.java
- ExperienceLevelDao.java
- OfferCandidatesDao.java
- OfferCandidateStatusDao.java
- OfferDao.java
- OfferStatusDao.java
- OriginDao.java
- ProfileDao.java
- StatusDao.java
- UserDao.java
- UserRoleDao.java
- service
- CandidateService.java
- MasterService.java
- UserService.java
- dao
- core
- model
- hr
- ontimize
- com
- resources
- dao
- CandidateDao.xml
- EducationDao.xml
- ExperienceLevelDao.xml
- OfferCandidatesDao.xml
- OfferCandidateStatusDao.xml
- OfferDao.xml
- OfferStatusDao.xml
- OriginDao.xml
- placeholders.properties
- ProfileDao.xml
- RoleDao.xml
- RoleServerPermissionDao.xml
- ServerPermissionDao.xml
- StatusDao.xml
- UserDao.xml
- UserRoleDao.xml
- dao
- db
- main
- pom.xml
- src
- hr-ws
- src
- main
- java
- com
- ontimize
- hr
- ws
- core
- rest
- CandidateRestController.java
- MainRestController.java
- MasterRestController.java
- TestRestController.java
- UserRestController.java
- rest
- core
- ws
- hr
- ontimize
- com
- java
- main
- pom.xml
- src
- .gitignore
- Archetype_ontimize_boot.postman_collection.json
- pom.xml
- hr-api
Creación del servicio
Creamos una clase como servicio e implementamos la interfaz anterior.
OfferService.java
- hr
- hr-api
- src
- main
- java
- com
- ontimize
- hr
- api
- core
- service
- ICandidateService.java
- IMasterService.java
- IOfferService.java
- IUserService.java
- service
- core
- api
- hr
- ontimize
- com
- java
- main
- pom.xml
- src
- hr-boot
- src
- main
- java
- com
- ontimize
- hr
- ServerApplication.java
- hr
- ontimize
- com
- resources
- application.yml
- java
- main
- pom.xml
- src
- hr-model
- src
- main
- db
- templateDB.script
- templateDB.txt
- java
- com
- ontimize
- hr
- model
- core
- dao
- CandidateDao.java
- EducationDao.java
- ExperienceLevelDao.java
- OfferCandidatesDao.java
- OfferCandidateStatusDao.java
- OfferDao.java
- OfferStatusDao.java
- OriginDao.java
- ProfileDao.java
- StatusDao.java
- UserDao.java
- UserRoleDao.java
- service
- CandidateService.java
- MasterService.java
- OfferService.java
- UserService.java
- dao
- core
- model
- hr
- ontimize
- com
- resources
- dao
- CandidateDao.xml
- EducationDao.xml
- ExperienceLevelDao.xml
- OfferCandidatesDao.xml
- OfferCandidateStatusDao.xml
- OfferDao.xml
- OfferStatusDao.xml
- OriginDao.xml
- placeholders.properties
- ProfileDao.xml
- RoleDao.xml
- RoleServerPermissionDao.xml
- ServerPermissionDao.xml
- StatusDao.xml
- UserDao.xml
- UserRoleDao.xml
- dao
- db
- main
- pom.xml
- src
- hr-ws
- src
- main
- java
- com
- ontimize
- hr
- ws
- core
- rest
- CandidateRestController.java
- MainRestController.java
- MasterRestController.java
- TestRestController.java
- UserRestController.java
- rest
- core
- ws
- hr
- ontimize
- com
- java
- main
- pom.xml
- src
- .gitignore
- Archetype_ontimize_boot.postman_collection.json
- pom.xml
- hr-api
Creación del controlador
Esta clase servirá para responder a las peticiones REST del servicio OfferService.
OfferRestController.java
- hr
- hr-api
- src
- main
- java
- com
- ontimize
- hr
- api
- core
- service
- ICandidateService.java
- IMasterService.java
- IOfferService.java
- IUserService.java
- service
- core
- api
- hr
- ontimize
- com
- java
- main
- pom.xml
- src
- hr-boot
- src
- main
- java
- com
- ontimize
- hr
- ServerApplication.java
- hr
- ontimize
- com
- resources
- application.yml
- java
- main
- pom.xml
- src
- hr-model
- src
- main
- db
- templateDB.script
- templateDB.txt
- java
- com
- ontimize
- hr
- model
- core
- dao
- CandidateDao.java
- EducationDao.java
- ExperienceLevelDao.java
- OfferCandidatesDao.java
- OfferCandidateStatusDao.java
- OfferDao.java
- OfferStatusDao.java
- OriginDao.java
- ProfileDao.java
- StatusDao.java
- UserDao.java
- UserRoleDao.java
- service
- CandidateService.java
- MasterService.java
- OfferService.java
- UserService.java
- dao
- core
- model
- hr
- ontimize
- com
- resources
- dao
- CandidateDao.xml
- EducationDao.xml
- ExperienceLevelDao.xml
- OfferCandidatesDao.xml
- OfferCandidateStatusDao.xml
- OfferDao.xml
- OfferStatusDao.xml
- OriginDao.xml
- placeholders.properties
- ProfileDao.xml
- RoleDao.xml
- RoleServerPermissionDao.xml
- ServerPermissionDao.xml
- StatusDao.xml
- UserDao.xml
- UserRoleDao.xml
- dao
- db
- main
- pom.xml
- src
- hr-ws
- src
- main
- java
- com
- ontimize
- hr
- ws
- core
- rest
- CandidateRestController.java
- MainRestController.java
- MasterRestController.java
- OfferRestController.java
- TestRestController.java
- UserRestController.java
- rest
- core
- ws
- hr
- ontimize
- com
- java
- main
- pom.xml
- src
- .gitignore
- Archetype_ontimize_boot.postman_collection.json
- pom.xml
- hr-api