小编krs*_*785的帖子

没有节点的数据类型:org.hibernate.hql.internal.ast.tree.IdentNode HQL

我有HQL,我试图获取没有分类的工件(当活动为0时)

artifacts = Artifact.findAll("FROM Artifact WHERE id NOT IN ( SELECT artifact_id FROM Classification WHERE active = 1) AND document_id = :docid",[docid:document.id], [max:limit, offset:startIndex]);
Run Code Online (Sandbox Code Playgroud)

每当我跑,我得到错误

java.lang.IllegalStateException: No data type for node: org.hibernate.hql.internal.ast.tree.IdentNode 
 \-[IDENT] IdentNode: 'artifact_id' {originalText=artifact_id}
Run Code Online (Sandbox Code Playgroud)

分类定义:

class Classification {

    public static final String USER_DEFAULT = "USER"
    public static final String USER_SYSTEM = "SYSTEM"

    TaxonomyNode node
    String artifactId 
    Boolean active
    String createdBy
    String updatedBy
    Date dateCreated
    Date lastUpdated


    static constraints = {
        node nullable:false, blank:false
        artifactId nullable:false, blank:false, unique: ['node'] …
Run Code Online (Sandbox Code Playgroud)

java grails hibernate hql

35
推荐指数
2
解决办法
7万
查看次数

在Angular JS中解码HTML实体

如何使用angular JS在文本中解码HTML实体.

我有字符串

""12.10 On-Going Submission of ""Made Up"" Samples.""
Run Code Online (Sandbox Code Playgroud)

我需要一种使用Angular JS解码的方法.我在这里找到了一种使用javascript的方法,但我相信它不适用于Angular.需要在UI上找回原始字符串,看起来像

""12.10 On-Going Submission of ""Made Up"" Samples.""
Run Code Online (Sandbox Code Playgroud)

html javascript html-entities utf8-decode angularjs

25
推荐指数
2
解决办法
5万
查看次数

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

我试图运行这个查询,这将给我计数,但它似乎确实有效

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);
Run Code Online (Sandbox Code Playgroud)

grails hibernate hql

1
推荐指数
1
解决办法
4537
查看次数

使用hibernate会话的Grails中的原始SQL:错误

我正在尝试使用hibernate会话在grails中执行此SQL.此SQL将返回工件表中的内容.这段代码有什么问题?

final session = sessionFactory.getCurrentSession();
final  String query  = "select a.* from classification c join (select id from taxonomy_node "+ 
                                                        "start with id = :nodeId connect by nocycle prior id = parent_id) h " +
                                                        "on (c.node.id = h.id) join artifact a on (a.id = c.artifact_id) " +
                                                        "Where a.DOCUMENT.ID = :docid AND c.active=1 ";
final sqlQuery = session.createSQLQuery(query);
artifact = sqlQuery.with {
        addEntity(Artifact, Classificatio, TaxonomyNode);
        setLong('nodeId',filterByAssociatedNodeId);
        setLong('docid',document.id);       
        list();
}
Run Code Online (Sandbox Code Playgroud)

我得到的错误

groovy.lang.MissingPropertyException: No such property: sessionFactory for class: com.th.ald.aeandsdx.ArtifactController
Run Code Online (Sandbox Code Playgroud)

我也尝试了一些这样的事情,比如将这个sql转换为HQL,就像 …

sql oracle grails hibernate hql

-1
推荐指数
1
解决办法
635
查看次数