@Override
	public int viewFriendReq(int profileOwnerID,
			Vector<HashMap<String, ByteIterator>> values, boolean insertImage, boolean testMode) {
		if(profileOwnerID < 0)
			return -1;
		session = sessionFactory.openSession();
		try {
			tx = session.beginTransaction();
			List<Friendship> obj = session.createCriteria(Friendship.class)
								.add(Restrictions.and(Restrictions.eq("inviteeid", Integer.toString(profileOwnerID)),
										Restrictions.eq("value", Integer.toString(1))))
								.list();
			Map<String, Method> methods = FactoryInsert.getGetterMethods(USERS.class);
			Set<String> keys = methods.keySet();
			keys.remove("confFriendCnt");
			keys.remove("pendFriendCnt");
			keys.remove("resCnt");

			
			HashMap<String, ByteIterator> uDetails;
			for(Friendship f : obj){
				uDetails = new HashMap<String, ByteIterator>();
				USERS user = (USERS) session.get(USERS.class, f.getInviterid());
				Iterator<String> it = keys.iterator();
				while(it.hasNext()){
					String key = it.next();
					if(!insertImage && (key.equalsIgnoreCase("pic") || key.equalsIgnoreCase("tpic")))
						continue;
					Method methd = methods.get(key);
					Object r = methd.invoke(user, null);
					uDetails.put(key, new ObjectByteIterator(r.toString().getBytes()));											
				}
				values.add(uDetails);
			}
//			System.out.println("friend requests for "+profileOwnerID+" counts: "+values.size());
			tx.commit();
			return 0;
		}catch (Exception e) {
			System.out.println("view friend reqs: "+ profileOwnerID);
			e.printStackTrace(System.out);
			return -1;
		}
		finally{
			session.close();
		}
	}