HIbernate: Persistance Query API Problems (#7104)

IDEA unable to reslove the named queries
Code:
try {
Query query = getSession().getNamedQuery(
"IssueRelationsByIssueQuery");
query.setInteger("issueId", issueId);
relations = query.list();
} catch (HibernateException ex) {
throw convertHibernateAccessException(ex);
}

"IssueRelationsByIssueQuery" shows red, but this is declared in one of the hbm.xml

]]>

1 comment
Comment actions Permalink

Please verify the following:
That hbm.xml should be shown in JavaEE structure view under some session
factory node.
The code should be in the same module as the factory or depend on it.


Rambabu Talasila wrote:

IDEA unable to reslove the named queries
Code:
try {
Query query = getSession().getNamedQuery(
"IssueRelationsByIssueQuery");
query.setInteger("issueId", issueId);
relations = query.list();
} catch (HibernateException ex) {
throw convertHibernateAccessException(ex);
}

"IssueRelationsByIssueQuery" shows red, but this is declared in one of the hbm.xml

<query name="IssueRelationsByIssueQuery"><![CDATA[
select relation
from IssueRelation as relation
where relation.issue.id = :issueId ]]>
</query>

0

Please sign in to leave a comment.