HQL错误:with-clause引用了两个不同的from子句元素

时间:2014-11-06 13:57:15

标签: hibernate grails hql

我正在尝试运行此查询,这将给我计数 但它似乎确实有效

def query  = "select count(A.id) from Artifact A "+
             "LEFT JOIN A.classification C on (A.id=C.artifactId) "+
             "where C.id IS NULL";
def tc = Artifact.executeQuery(query);

1 个答案:

答案 0 :(得分:7)

这可能有所帮助:

def query  = "select count(A.id) from Artifact A "+
             "LEFT JOIN A.classification C "+
             "where C.id IS NULL";
def tc = Artifact.executeQuery(query);

你不需要在这里,因为神器应该已经连接了#34;通过映射进行分类。