August 2018
Intermediate to advanced
314 pages
8h 9m
English
The EmployeeBusiness class has the employee business logic:
import javax.ejb.Stateless;import javax.inject.Inject;import java.util.Optional;@Statelesspublic class EmployeeBusiness{ @Inject @Persistence protected PersistenceManager persistenceManager; public boolean save ( Employee employee ) throws Exception { //Begin Transaction persistenceManager.begin(); persistenceManager.persist(employee); //End Transaction persistenceManager.commit(); return true; } public Optional<Employee> findById(Employee employee ){ return Optional.ofNullable( (Employee) persistenceManager.load(employee.getId()).get()); }}
In the preceding code block, we have the EmployeeBusiness class, which has the employee business ...
Read now
Unlock full access