Commit 61e65a13 authored by Matija Obreza's avatar Matija Obreza

Fix: Added missing fetch join RepositoryFile in find*Attachments()

parent d04db54f
...@@ -38,15 +38,20 @@ public class AccessionInvAttachRepositoryCustomImpl implements AccessionInvAttac ...@@ -38,15 +38,20 @@ public class AccessionInvAttachRepositoryCustomImpl implements AccessionInvAttac
@Override @Override
public List<AccessionInvAttach> findAccessionAttachments(Accession accession, String formTypeCode) { public List<AccessionInvAttach> findAccessionAttachments(Accession accession, String formTypeCode) {
BooleanExpression expression = QAccessionInvAttach.accessionInvAttach.inventory.accession.eq(accession); BooleanExpression expression = QAccessionInvAttach.accessionInvAttach.inventory.accession.eq(accession);
if (StringUtils.isNotBlank(formTypeCode)) { if (StringUtils.isNotBlank(formTypeCode)) {
expression = expression.and(QAccessionInvAttach.accessionInvAttach.inventory.formTypeCode.eq(formTypeCode)); expression = expression.and(QAccessionInvAttach.accessionInvAttach.inventory.formTypeCode.eq(formTypeCode));
} }
return jpaQueryFactory.selectFrom(QAccessionInvAttach.accessionInvAttach).where(expression).fetch();
return jpaQueryFactory.selectFrom(QAccessionInvAttach.accessionInvAttach)
.join(QAccessionInvAttach.accessionInvAttach.repositoryFile).fetchJoin()
.where(expression).fetch();
} }
@Override @Override
public List<AccessionInvAttach> findInventoryAttachments(Inventory inventory) { public List<AccessionInvAttach> findInventoryAttachments(Inventory inventory) {
return jpaQueryFactory.selectFrom(QAccessionInvAttach.accessionInvAttach) return jpaQueryFactory.selectFrom(QAccessionInvAttach.accessionInvAttach)
.join(QAccessionInvAttach.accessionInvAttach.repositoryFile).fetchJoin()
.where(QAccessionInvAttach.accessionInvAttach.inventory.eq(inventory)).fetch(); .where(QAccessionInvAttach.accessionInvAttach.inventory.eq(inventory)).fetch();
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment