Code example for Session

Methods: closecreateSQLQuery

0
		SessionFactory sessionFactory = SpringUtils.readXmlWebRootForContext();
		Session session = sessionFactory.openSession();
		System.out.println("读取自己的appInfo表数据");
		CmsAppInfo cmslog = new CmsAppInfo();
 
		int recordCount = session.createSQLQuery("select * from jc_app_info ")
				.list().size();
 
		System.out.println("查询到数据jc_app_info表数据:" + recordCount + "条");
		session.close();
 
	} 
 
	// insert into jc_app_info 
	// values(1,1,'topic_home','short_home','keywords','descrip','title_ime','content','tpl',10,1); 
 
}