From ecbc2be47c29fbb690eea526cb6fcbdaca6b12af Mon Sep 17 00:00:00 2001 From: Josef Rokos Date: Wed, 21 Jan 2015 10:59:15 +0100 Subject: [PATCH] =?UTF-8?q?V=20agend=C4=9B=20Fakturace=20po=C5=BEadavk?= =?UTF-8?q?=C5=AF=20byl=20opraven=20lazy=20load=20vlastn=C3=ADka=20po?= =?UTF-8?q?=C5=BEadavku.=20refs=20#182?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../isspst/services/invoicing/InvoicingServiceImpl.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/info/bukova/isspst/services/invoicing/InvoicingServiceImpl.java b/src/main/java/info/bukova/isspst/services/invoicing/InvoicingServiceImpl.java index 9fb504b9..d7263af3 100644 --- a/src/main/java/info/bukova/isspst/services/invoicing/InvoicingServiceImpl.java +++ b/src/main/java/info/bukova/isspst/services/invoicing/InvoicingServiceImpl.java @@ -64,5 +64,13 @@ public class InvoicingServiceImpl extends AbstractOwnedService implem Query q = dao.getQuery("select inv from Invoicing as inv join fetch inv.requirement rq join fetch rq.ownedBy order by rq.numser"); return q.list(); } + + @Transactional + @LazyLoader("form") + public void loadOwnedBy(Invoicing invoice) { + Invoicing inv = getById(invoice.getId()); + Hibernate.initialize(inv.getRequirement().getOwnedBy()); + invoice.getRequirement().setOwnedBy(inv.getRequirement().getOwnedBy()); + } }