public static void main(String[] args) {
		Session session = InitSession();
//		Transaction tx = session.beginTransaction();
//		session.save(CreateOrder());
//		tx.commit();

		try {

			// from后面是对象，不是表名
			String hql = "from SalesOrder as SalesOrder where SalesOrder.code=:code";

			Query query = session.createQuery(hql);

			query.setString("code", "TestSalesOrder");

			List<SalesOrder> list = query.list();

			for (SalesOrder so : list) {

				System.out.println(so.getIdCard());
			}

		} finally {

			if (session != null)

				session.close();
		}

	}