I have a table Sub_Fact_Profile in that three columns User_Id,Name and Profile.
[code]User_Id[/code] [code]Name[/code] [code] Profile [/code]
[code]sat[/code] [code]ramu[/code] [code]<?.xml data.?>[/code]
[code]sat[/code] [code]venu[/code] [code]<?.xml data.?>[/code]
[code]sat[/code] [code]mam[/code] [code]<?.xml data.?>[/code]
[code]sat[/code] [code]jasui[/code] [code]<?.xml data.?>[/code]
I am trying to retrieving data from this table using the code shown below
Criteria crit=session.createCriteria(Sub_Fact_Profile.class);
crit.add(Restrictions.like("User_Id",userid));
List ll=crit.list();
for(Iterator it=ll.iterator();it.hasNext();)
{
Sub_Fact_Profile sfp =(Sub_Fact_Profile)it.next();
System.out.println("Name Profile Maneger--"+sfp.getUser_Id());
System.out.println("Name Profile Maneger--"+sfp.getName());
}
session.close();
I am expecting for the same User_Id different Names present in the table but the result i am getting is only first row Name for 4 times while i iterated.
answer i get when i iterated shown below
[code]sat[/code] [code]ramu[/code]
[code]sat[/code] [code]ramu[/code]
[code]sat[/code] [code]ramu[/code]
[code]sat[/code] [code]ramu[/code]
but i want answer like
[code]sat[/code] [code]ramu[/code]
[code]sat[/code] [code]venu[/code]
[code]sat[/code] [code] mam[/code]
[code]sat[/code] [code]jasui [/code]
Can anybody help me whats the wrong i am doing..
thanks in advance
JC
|