Beginner |
|
Joined: Mon Sep 06, 2004 9:36 am Posts: 35
|
Hi Anthony,
i am trying to understand how to use hibernate with web-tier.
I have created an EJB which has a method "retrieveEmployeePosition" to retrieve data. It returns a POJO.
public EmployeePosition retrieveEmployeePosition( Integer employeeId ) {
HibernateUtil.getSession();
HibernateUtil.beginTransaction();
...
HibernateUtil.commitTransaction();
HibernateUtil.closeSession();
return aEmployeePostion;
}
i have a jsp which calls this EJB method to retrieve the data:
EmployeePosition aEmployeePosition = aEmployeeDelegate.retrieveEmployeePosition( employeeId );
then i show the data in different html controls (textbox etc) using aEmployeePosition.getxxx()
my question is should i save the aEmployeePosition on my web-tier and if yes then where? what hibernate recommends?
when user makes the changes and want to update the database then what should be the line of action w.r.t hibernate?
Please reply.
Thanks
JY
|
|