查了好多资料,终于解决:
String hql=" from EventtypeTable where eventTypeName=:eve";
Query query=session.createQuery(hql);
query.setString("eve","你好");
这样查时如果为空,很简单的解决办法:
hibernate中
jdbc:mysql://localhost:3306/nihao?useUnicode=true&characterEncoding=UTF-8
nihao为数据库名
这样就能取值了