阅读hibernate 如何动态创建sql语句,发现了不一样的拼接方式,在notexpression类它的拼接方式:not + 表达式,如 not column in (?)
常见的拼接式 column not in (?)
public String toSqlString(Criteria criteria, CriteriaQuery criteriaQuery)
throws HibernateException {
if ( criteriaQuery.getFactory().getDialect() instanceof MySQLDialect ) {
return "not (" + criterion.toSqlString(criteria, criteriaQuery) + ')';
}
else {
return "not " + criterion.toSqlString(criteria, criteriaQuery);
}
}
常见的拼接式 column not in (?)