protected Object getEntity(Class clazz, Object id) {
		Session session = null;
		Object o = null;

		try {
			session = getSession();
			o = session.get(clazz, (Serializable) id);
		} catch (RuntimeException e) {
			logger.error("Error returning class"+clazz+" with id"+ id);
			e.printStackTrace();
		} finally {
			if (session != null) {
				session.close();
			}
		}
		return o;
	}