org.jpos.ee.DB.exec()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(197)

本文整理了Java中org.jpos.ee.DB.exec()方法的一些代码示例,展示了DB.exec()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DB.exec()方法的具体详情如下:
包路径:org.jpos.ee.DB
类名称:DB
方法名:exec

DB.exec介绍

暂无

代码示例

代码示例来源:origin: jpos/jPOS-EE

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();
}

代码示例来源:origin: jpos/jPOS-EE

@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();
}

代码示例来源:origin: jpos/jPOS-EE

@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();
}

代码示例来源:origin: jpos/jPOS-EE

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();
}

代码示例来源:origin: jpos/jPOS-EE

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();
}

代码示例来源:origin: jpos/jPOS-EE

@Override
public int getItemCount() throws Exception {
  return DB.exec(db -> {
    AccountManager mgr = new AccountManager(db);
    return mgr.getItemCount();
  });
}

代码示例来源:origin: jpos/jPOS-EE

@Override
public int getItemCount() throws Exception {
  return (int) DB.exec(db -> {
    SysConfigManager mgr = new SysConfigManager(db,prefix);
    return mgr.getItemCount();
  });
}

代码示例来源:origin: jpos/jPOS-EE

@Override
public int getItemCount() throws Exception {
  return (int) DB.exec(db -> {
    RoleManager mgr = new RoleManager(db);
    return mgr.getItemCount();
  });
}

代码示例来源:origin: jpos/jPOS-EE

@Override
public int getItemCount() throws Exception {
  return (int) DB.exec(db -> {
    UserManager mgr = new UserManager(db);
    return mgr.getItemCount();
  });
}

代码示例来源:origin: jpos/jPOS-EE

private int getChildrenCount(Account parent) throws Exception {
  return DB.exec(db -> {
    db.session().refresh(parent);
    return parent.getChildren().size();
  });
}

代码示例来源:origin: jpos/jPOS-EE

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;
    }
  }
}

代码示例来源:origin: jpos/jPOS-EE

private boolean hasChildrenAccounts(Account parent) throws Exception {
  return DB.exec(db -> {
    db.session().refresh(parent);
    return parent.getChildren() != null && parent.getChildren().size() > 0;
  });
}

代码示例来源:origin: jpos/jPOS-EE

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;
  }
}

代码示例来源:origin: jpos/jPOS-EE

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;
  }
}

代码示例来源:origin: jpos/jPOS-EE

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;
  }
}

代码示例来源:origin: jpos/jPOS-EE

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();
  });
}

代码示例来源:origin: jpos/jPOS-EE

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;
  }
}

代码示例来源:origin: jpos/jPOS-EE

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;
  }
}

代码示例来源:origin: jpos/jPOS-EE

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;
  }
}

代码示例来源:origin: jpos/jPOS-EE

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;
    }
  }
}

相关文章