private static Location getLocation(String location)
			throws NewCustomException {

		Session session = null;
		Transaction tx = null;
		Location loc = null;
		try {
			session = HibernateUtil.createSessionFactory().openSession();
			tx = session.beginTransaction();
			Criteria criteria = session.createCriteria(Location.class);
			criteria.add(Restrictions.eq("location", location));
			List<Location> locList = criteria.list();

			if (locList.size() == 0) {
				loc = null;
			} else {
				loc = locList.get(0);
			}
			tx.commit();

		} catch (HibernateException e) {
			e.printStackTrace();
			if (tx != null)
				tx.rollback();
			throw new NewCustomException("Error in Finding Location");
		} finally {
			session.close();
		}
		return loc;
	}