public static List<process> viewRecord(String s[]){
SessionFactory sf=new Configuration().configure().buildSessionFactory();
Session session=sf.openSession();
Criteria c1=session.createCriteria(process.class);
// c1.add(Restrictions.and(Restrictions.eq("id", new Integer(0)),Restrictions.like("username","vipul")));
// c1.addOrder(Order.desc("id"));
// c1.setProjection(Projections.property("username"));
// c1.setProjection(Projections.property("address"));
int len=s.length;
System.out.println(len);
ProjectionList p1=Projections.projectionList();
for(int i=0; i<len; i++)
{
p1.add(Projections.property(s[i]));
System.out.println(s[i]);
// p1.add(Projections.property("address"));
}
c1.setProjection(p1);
List l1 = (List) c1.list();
// Iterator i =l1.iterator();
// while(i.hasNext())
//{
// Object o[]=(Object [])i.next();
// System.out.println(o[0] + "==" + o[1]);
// String str=(String) i.next();
// System.out.println(str);
/*
Object o=i.next();
login l11=(login)o;
System.out.println(l11.getid());
System.out.println(l11.getaddress());
System.out.println(l11.getemail());
System.out.println(l11.getpassword());
System.out.println(l11.getphonenumber());
System.out.println(l11.getusername());
*/
//}
System.out.println("save");
session.close();
sf.close();
return l1;