Challenge: Role Layers Implementation
Task
Now let's get to the task:
Your task is to implement the methods in the classes RoleDaoImpl
, RoleServiceImpl
, EmployeeDaoImpl
, and EmployeeServiceImpl
. This is not difficult; you have done this many times. The only potential challenge might be with the updateRole
method, but I'm confident you can handle it.
To test your solution, you need to run the code I have written for you in the main class. Then, you will need to compare the result with the correct result, which I will provide below.
Testing such large applications with database interaction implementation becomes increasingly challenging, so now your project will be tested by yourself (or you can peek at the Solution).
Correct output:
RoleDao
interface. You've done this many times before, so there shouldn't be any problems. 2. For the method with role update, use the following algorithm: Retrieve the role from the database, reassign the role's fields with new values, and use the
session.merge()
method.3. To implement the
setRoleById()
method and override it, you can use the template from the previous chapter. You need to do the same thing. 4. Run the main class and compare your result with the expected one.
¿Todo estuvo claro?
Contenido del Curso
Java Data Manipulation with Hibernate
2. Fundamentals of Hibernate
Java Data Manipulation with Hibernate
Challenge: Role Layers Implementation
Task
Now let's get to the task:
Your task is to implement the methods in the classes RoleDaoImpl
, RoleServiceImpl
, EmployeeDaoImpl
, and EmployeeServiceImpl
. This is not difficult; you have done this many times. The only potential challenge might be with the updateRole
method, but I'm confident you can handle it.
To test your solution, you need to run the code I have written for you in the main class. Then, you will need to compare the result with the correct result, which I will provide below.
Testing such large applications with database interaction implementation becomes increasingly challenging, so now your project will be tested by yourself (or you can peek at the Solution).
Correct output:
RoleDao
interface. You've done this many times before, so there shouldn't be any problems. 2. For the method with role update, use the following algorithm: Retrieve the role from the database, reassign the role's fields with new values, and use the
session.merge()
method.3. To implement the
setRoleById()
method and override it, you can use the template from the previous chapter. You need to do the same thing. 4. Run the main class and compare your result with the expected one.
¿Todo estuvo claro?