我有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) 如何使用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) 我试图运行这个查询,这将给我计数,但它似乎确实有效
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) 我正在尝试使用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,就像 …
grails ×3
hibernate ×3
hql ×3
angularjs ×1
html ×1
java ×1
javascript ×1
oracle ×1
sql ×1
utf8-decode ×1