Hi, I’m trying to figure out the better way to use QueryDSL within mi Jira app.
this.queryDslAccessor = ComponentAccessor.getComponent(QueryDslAccessor.class);
return queryDslAccessor.executeQuery(dbConnection -> {
return dbConnection.newSqlQuery()
.select(QIssueLink.ISSUE_LINK.source)
.where(QIssueLink.ISSUE_LINK.linktype.eq(subtaskLinkTypeId))
.groupBy(QIssueLink.ISSUE_LINK.source)
.having(QIssueLink.ISSUE_LINK.source.count().gt(0))
.fetch()
.stream()
.map(issueId -> new QueryLiteral(operand, issueId))
.collect(Collectors.toList());
});
I’ve tried to use QueryDslAccesor class but it thrown an error on the logs each time I try to use it:
2019-11-13 23:32:29,593 http-nio-8080-exec-20 WARN admin 1412x14288x1 49garj 0:0:0:0:0:0:0:1 /secure/QueryComponent!Jql.jspa [c.atlassian.ozymandias.SafePluginPointAccess] A LinkageError indicates that plugin code was compiled with outdated versions. Unable to run plugin code because of 'java.lang.LinkageError - loader constraint violation: loader (instance of org/apache/felix/framework/BundleWiringImpl$BundleClassLoaderJava5) previously initiated loading for a different type with name "com/querydsl/sql/SQLQuery"'.
Also I’ve tried to setup the atlassian-pocketknife-querydsl library but I get lot of OSGI dependencies problems, have someone a working example?
Thanks!