18 package org.turro.attach.zul.navigator;
20 import org.turro.attach.db.AttachPU;
21 import org.turro.jpa.Dao;
29 private final Long size, versionedSize;
34 "select sum(a.fileSize) from Attachment a where a.path like ? or a.path = ?",
35 new Object[] {path +
"/%", path});
36 size = (Long) dao.getSingleResultOrNull(
37 "select sum(a.fileSize) from Attachment a where (a.path like ? or a.path = ?) " +
38 "and a.modification = ( " +
39 "select max(a2.modification) from Attachment a2 " +
40 "where a2.path = a.path " +
41 "and a2.fileName = a.fileName " +
43 new Object[] {path +
"/%", path});
47 return size ==
null ? 0 : size;
51 return versionedSize ==
null ? 0 : versionedSize;
Object getSingleResultOrNull(SqlClause sc)