Devi Ramadass

Greenhorn
+ Follow
since Sep 20, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Devi Ramadass

Hi,


//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 ]
Hai,

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.

Thank you for all Inputs.
Regards
Devi Ramadass
Any Inputs Please....

Regards
Devi Ramadass
Hi,

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 .

Regards
Devi Ramadass.
[ October 09, 2008: Message edited by: Devi Ramadass ]
Hi,

This is the query i am using



From this query how can i get the id and set it to Employee object for delete.

Regards
Devi Ramadass
Any inputs...........

Regards
Devi Ramadass
Hi,

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.



In my table structure is


Employee.class


EmployeeDBConn.java


EmployeeList.java




Jsp Code is


Please suggest me.

Regards
Devi Ramadass

[ Edited to use code tags - Paul Sturrock ]
[ September 29, 2008: Message edited by: Paul Sturrock ]
Hi,

Any one knows please help me.

Regards
Devi Ramadass
Hi,

I want to delete the paricular record in hibernate web application. Can anyone knows please tell me.

Regards
Devi Ramadass
Hi,

I am corrected the param tag, now it's working.Thank You Tom.

Regards,
R.Devi
15 years ago
Hi,

Thank you so much for your help, i have the accessor/mutator methods for EMPID. Please look at the below code and suggest.

Employee.java
public class Employee
{
private String firstName;
private String lastName;
private String designation;
private int id;
public Employee()
{
}
public Employee(int id,String firstName,String lastName,String designation)
{
this.id = id;
this.firstName = firstName;
this.lastName = lastName;
this.designation = designation;
}
//setter and getter methods for firstName,lastName,designation
public int getId()
{
return id;
}
public void setId(int id)
{
this.id = id;
}
}

Regards,
Devi Ramadass
15 years ago
Hi,

Thanks for your reply, i am getting the particular empid(record id) inside execute method through this statement "employee.getId();".But i could not get the same id inside deleteEmployee() method.How can i get the id in deleteEmployee() method.Because i want to delete particular record.

Regards,
Devi Ramadass
15 years ago
Any inputs ....

Regards
Devi Ramadass
15 years ago
Hi,
I am using struts2(using ActionSupport class),In the employee list i want to delete a particular record.For that how can I get the id inside DAO Class.

Note:
I am using param tag to pass id value.
<s:url id="delete" action="delete">
<s aram name="employee.EMPID" value="id"/>
</s:url>

Regards
Devi Ramadass
15 years ago