@Test public void showResult() { Person p1 = new Person("karl", 18); Person p2 = new Person("tam", 22); Person p3 = new Man("tam", 22, "worker"); List<Person> personList = new ArrayList<>(); for (int i = 0; i < 1000000; i++) { personList.add(new Person("name" + i, 18)); } StopWatch stopWatch = new StopWatch(); stopWatch.start(); StringBuilder sb = new StringBuilder(); for (Person person : personList) { sb.append("\n"); } stopWatch.stop(); log.debug(sb.toString()); log.debug("use : {}", stopWatch.getLastTaskTimeMillis()); }
public <TView> void showResult(List<TView> result) { if (showResult == false) { return; } if (log.isDebugEnabled()) { return; } StringBuilder logStr = new StringBuilder(); logStr.append(System.lineSeparator()); logStr.append("################# MYFAVS ORM SHOW RESULT #################"); logStr.append(System.lineSeparator()); logStr.append(System.lineSeparator()); logStr.append(" QUERY RESULT:"); logStr.append(System.lineSeparator()); logStr.append(System.lineSeparator()); for (Iterator<TView> iterator = result.iterator(); iterator.hasNext(); ) { TView next = iterator.next(); logStr.append(JSON.toJSONString(next)); logStr.append(System.lineSeparator()); } logStr.append(System.lineSeparator()); logStr.append(StrUtil.format("TOTAL RECORDS: {}", result.size())); logStr.append(System.lineSeparator()); logStr.append(System.lineSeparator()); logStr.append("##########################################################"); log.debug(logStr.toString()); }
SqlLog { public <TView> void showResult(List<TView> result) { if (showResult == false) { return; } if (log.isDebugEnabled()) { return; } StringBuilder logStr = new StringBuilder(); logStr.append(System.lineSeparator()); logStr.append("################# MYFAVS ORM SHOW RESULT #################"); logStr.append(System.lineSeparator()); logStr.append(System.lineSeparator()); logStr.append(" QUERY RESULT:"); logStr.append(System.lineSeparator()); logStr.append(System.lineSeparator()); for (Iterator<TView> iterator = result.iterator(); iterator.hasNext(); ) { TView next = iterator.next(); logStr.append(JSON.toJSONString(next)); logStr.append(System.lineSeparator()); } logStr.append(System.lineSeparator()); logStr.append(StrUtil.format("TOTAL RECORDS: {}", result.size())); logStr.append(System.lineSeparator()); logStr.append(System.lineSeparator()); logStr.append("##########################################################"); log.debug(logStr.toString()); } }
SqlLog { public <TView> void showResult(List<TView> result) { if (showResult == false) { return; } if (log.isDebugEnabled()) { return; } StringBuilder logStr = new StringBuilder(); logStr.append(System.lineSeparator()); logStr.append("################# MYFAVS ORM SHOW RESULT #################"); logStr.append(System.lineSeparator()); logStr.append(System.lineSeparator()); logStr.append(" QUERY RESULT:"); logStr.append(System.lineSeparator()); logStr.append(System.lineSeparator()); for (Iterator<TView> iterator = result.iterator(); iterator.hasNext(); ) { TView next = iterator.next(); logStr.append(JSON.toJSONString(next)); logStr.append(System.lineSeparator()); } logStr.append(System.lineSeparator()); logStr.append(StrUtil.format("TOTAL RECORDS: {}", result.size())); logStr.append(System.lineSeparator()); logStr.append(System.lineSeparator()); logStr.append("##########################################################"); log.debug(logStr.toString()); } SqlLog(boolean showSql,
      boolean showResult); }
SqlLog { public <TView> void showResult(List<TView> result) { if (showResult == false) { return; } if (log.isDebugEnabled()) { return; } StringBuilder logStr = new StringBuilder(); logStr.append(System.lineSeparator()); logStr.append("################# MYFAVS ORM SHOW RESULT #################"); logStr.append(System.lineSeparator()); logStr.append(System.lineSeparator()); logStr.append(" QUERY RESULT:"); logStr.append(System.lineSeparator()); logStr.append(System.lineSeparator()); for (Iterator<TView> iterator = result.iterator(); iterator.hasNext(); ) { TView next = iterator.next(); logStr.append(JSON.toJSONString(next)); logStr.append(System.lineSeparator()); } logStr.append(System.lineSeparator()); logStr.append(StrUtil.format("TOTAL RECORDS: {}", result.size())); logStr.append(System.lineSeparator()); logStr.append(System.lineSeparator()); logStr.append("##########################################################"); log.debug(logStr.toString()); } SqlLog(boolean showSql,
      boolean showResult); void showSql(String sql,
      Collection params); void showBatchSql(String sql,
      Collection<Collection> paramsList); void showAffectedRows(int result); void showResult(List<TView> result); }
SqlLog { public <TView> void showResult(List<TView> result) { if (showResult == false) { return; } if (log.isDebugEnabled()) { return; } StringBuilder logStr = new StringBuilder(); logStr.append(System.lineSeparator()); logStr.append("################# MYFAVS ORM SHOW RESULT #################"); logStr.append(System.lineSeparator()); logStr.append(System.lineSeparator()); logStr.append(" QUERY RESULT:"); logStr.append(System.lineSeparator()); logStr.append(System.lineSeparator()); for (Iterator<TView> iterator = result.iterator(); iterator.hasNext(); ) { TView next = iterator.next(); logStr.append(JSON.toJSONString(next)); logStr.append(System.lineSeparator()); } logStr.append(System.lineSeparator()); logStr.append(StrUtil.format("TOTAL RECORDS: {}", result.size())); logStr.append(System.lineSeparator()); logStr.append(System.lineSeparator()); logStr.append("##########################################################"); log.debug(logStr.toString()); } SqlLog(boolean showSql,
      boolean showResult); void showSql(String sql,
      Collection params); void showBatchSql(String sql,
      Collection<Collection> paramsList); void showAffectedRows(int result); void showResult(List<TView> result);  }