HQL table named "Class"
I'm creating hql and use
var queryString = "from " + formType.Name;
queryString += " where Id= :t";
var query = SessionHelper.GetSession().CreateQuery(queryString).SetParameter("t", id);
My problem is 开发者_StackOverflow社区that I have table named "Class" and model Class.. So problem is that sometime formType.Name is Class and I get queryString as from Class where Id= :t and as class is keyword that throws me QuerySyntaxException. How to tell query that Class is entity name instead keyword. Thanks!
Use backticks in your mapping
<class name="´Class´">
精彩评论