Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
Have you tried the Hibernate APIs? For pre-Hibernate3, you can use Session.delete(), and for current versions its recommended you should use HQL's createQuery() with delete in the query.
In my code i am not getting idea to delete the particular record from the list. 1.How i get the id in the DAO Class for deleting? 2.I sent the through param tag.
From this query how can i get the id and set it to Employee object for delete.
You don't need to set it in the Employee object, Hibernate does that for you. The result of your query is a List of Employee objects. Their ID property will be populated already.
Thank you for your reply It's working fine.But Could you suggest how to get the id of the particular record which is selected from the list instead of assigning it statically (int id=123 .
If you ask Hibernate to employee.getId() it will give you the ObjectId which was assigned.
I have seen your code there was long id has mentioned your EMPLOYEE class it will return Id of your object.
~Ramesh..
------------------ If i print the return id through this statement System.out.println("Employee Id="+employee.getId()) i am getting the value zero. Instead of that i want to get the selected employee id.Please suggest.
//user Id - you will pass this value to this query at run time.String query String query = "from User as user where user.userID=:userId"
I passing the employee id but i am getting the value zero. Instead of that i want to get the selected employee id.Please suggest. Regards Devi Ramadass. [ October 11, 2008: Message edited by: Devi Ramadass ]
Rather asking same question repeatedly... please google and try to understnad some basic concepts arround Hibernate...javascript:%20x() javascript:%20x()javascript:%20x()
Vijay Gadde
Coming together is a beginning. Keeping together is progress.. Working together is success........
There are no more "hours", it's centi-days. They say it's better, but this tiny ad says it's stupid:
Free, earth friendly heat - from the CodeRanch trailboss