@Override
	public int postCommentOnResource(int commentCreatorID, int profileOwnerID,
			int resourceID, HashMap<String,ByteIterator> commentValues) {
		if(profileOwnerID < 0 || commentCreatorID < 0 || resourceID < 0)
			return -1;
		session = sessionFactory.openSession();
		try {
			tx = session.beginTransaction();
			System.out.println("posting comment");
			
			MANIPULATIONS manip = new MANIPULATIONS();
			
			Map<String, Method> methods = FactoryInsert.getSetterMethods(MANIPULATIONS.class);
			methods.get("mid").invoke(manip, commentValues.get("mid").toString());
			methods.get("creatorid").invoke(manip, profileOwnerID);
			methods.get("rid").invoke(manip, resourceID);
			methods.get("modifierid").invoke(manip, commentCreatorID);
			methods.get("timestamp").invoke(manip, commentValues.get("timestamp").toString());
			methods.get("type").invoke(manip, commentValues.get("type").toString());
			methods.get("content").invoke(manip, commentValues.get("content").toString());
			
			session.save(manip);
			System.out.println("posted comment on "+profileOwnerID+" by "+commentCreatorID);
			tx.commit();
			return 0;

		}catch (IllegalAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			return -1;
		} catch (IllegalArgumentException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			return -1;
		} catch (InvocationTargetException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			return -1;
		}finally{
			session.close();
		}
	}