Hi_Amos
坚持每天都在进步!!
public class RegisterStory {
	private SysUserCDao sysUserCDao;
	@Test
	public void test() {
		SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
        Session session=sessionFactory.openSession();  
        Transaction tx = session.beginTransaction();
        String sql = "select * from sys_user where account='your_account'";
        List list = session.createQuery(sql).list();
        Iterator iterator = list.iterator();
        while (iterator.hasNext()) {
        	SysUserC sys_user = (SysUserC)iterator.next();
        	String user_id = sys_user.getUser_id();
        	System.err.println("user_id:"+user_id);
		}
        tx.commit();
        session.close();  
	}

}

 

posted on 2013-10-24 15:02  Hi_Amos  阅读(421)  评论(0编辑  收藏  举报