public Stream getAll(int offset, int limit, Map<String, Boolean> orders, User user) throws Exception { return (DB.exec(db -> { ConsumerManager mgr = new ConsumerManager(db,user); return mgr.getAll(offset,limit,orders); })).stream(); }
@Override public Stream getAll(int offset, int limit, Map<String, Boolean> orders) throws Exception { List<Account> agents = DB.exec(db -> { AccountManager mgr = new AccountManager(db); return mgr.getAll(offset,limit,orders); }); return agents.stream(); }
@Override public Stream getAll(int offset, int limit, Map<String, Boolean> orders) throws Exception { List<Role> list = (List<Role>) DB.exec(db -> { RoleManager mgr = new RoleManager(db); return mgr.getAll(offset,limit,orders); }); return list.stream(); }
private Stream getAllChildren(int offset, int limit, Map<String,Boolean> orders, Account parent) throws Exception { List<Account> accounts = DB.exec(db -> { AccountManager mgr = new AccountManager(db); return mgr.getAllChildren(offset,limit,orders,parent); }); return accounts.stream(); }
private Stream getPossibleParents(int offset, int limit, Map<String,Boolean> orders) throws Exception { List<CompositeAccount> accounts = DB.exec(db -> { AccountManager mgr = new AccountManager(db); return mgr.getCompositeAccounts(offset,limit,orders); }); return accounts.stream(); }
@Override public int getItemCount() throws Exception { return DB.exec(db -> { AccountManager mgr = new AccountManager(db); return mgr.getItemCount(); }); }
@Override public int getItemCount() throws Exception { return (int) DB.exec(db -> { SysConfigManager mgr = new SysConfigManager(db,prefix); return mgr.getItemCount(); }); }
@Override public int getItemCount() throws Exception { return (int) DB.exec(db -> { RoleManager mgr = new RoleManager(db); return mgr.getItemCount(); }); }
@Override public int getItemCount() throws Exception { return (int) DB.exec(db -> { UserManager mgr = new UserManager(db); return mgr.getItemCount(); }); }
private int getChildrenCount(Account parent) throws Exception { return DB.exec(db -> { db.session().refresh(parent); return parent.getChildren().size(); }); }
public Journal getJournal (long id) { try { return (Journal) DB.exec(db -> db.session().get(Journal.class, id)); } catch (Exception e) { getApp().getLog().error(e); return null; } } }
private boolean hasChildrenAccounts(Account parent) throws Exception { return DB.exec(db -> { db.session().refresh(parent); return parent.getChildren() != null && parent.getChildren().size() > 0; }); }
public Layer getLayer (Short id, Journal journal) { try { return (Layer) DB.exec(db -> db.session().get(Layer.class, new Layer(id, journal))); } catch (Exception e) { getApp().getLog().error(e); return null; } }
public User getUserByNick (String nick, boolean includeDeleted) { try { return (User) DB.exec((db) -> { UserManager mgr = new UserManager(db); return mgr.getUserByNick(nick,includeDeleted); }); } catch (Exception e) { getApp().getLog().error(e); return null; } }
public List<SysConfig> getPermissions () { try { return (List<SysConfig>) DB.exec( (db) -> { SysConfigManager mgr = new SysConfigManager(db, "perm."); return mgr.getAll(); }); } catch (Exception e) { getApp().getLog().error(e); return null; } }
public int getItemCount(Long journalId, DateRange range) throws Exception { return (int) DB.exec(db -> { GLTransactionManager mgr; if (journalId != null && range != null) mgr = new GLTransactionManager(db,journalId,range.getStart(),range.getEnd()); else mgr = new GLTransactionManager(db); return mgr.getItemCount(); }); }
public List<Journal> getJournals() { try { return (List<Journal>) DB.exec(db -> { GLSession session = new GLSession(db); return session.getAllJournals(); }); } catch (Exception e) { getApp().getLog().error(e); return null; } }
public List<Role> getRoles() { try { return (List<Role>) DB.exec((db) -> { RoleManager mgr = new RoleManager(db); return mgr.getAll(); }); } catch (Exception e) { getApp().getLog().error(e); return null; } }
public List<Layer> getLayers (Journal journal) { try { return (List<Layer>) DB.exec(db -> { db.session().enableFetchProfile("eager"); db.session().refresh(journal); return new ArrayList<Layer>(journal.getLayers()); }); } catch (Exception e) { getApp().getLog().error(e); return null; } }
private String getDefaultJournalName() { try { return DB.exec(db -> { SysConfigManager syscMgr= new SysConfigManager(db); return syscMgr.get(MiniGLConstants.DEFAULT_GL_JOURNAL.toString(), "jcard"); }); } catch (Exception e) { QI.getQI().getLog().error(e); return null; } } }