/** * @see de.micromata.hibernate.history.web.HistoryFormatter#formatTimestamp(org.hibernate.Session, java.util.Locale, * de.micromata.hibernate.history.HistoryEntry) */ @Override public String formatTimestamp(Session session, final Locale locale, Object changed, HistoryEntry historyEntry, PropertyDelta delta) { return sdf.format(historyEntry.getModifiedAt()); }
public static List<? extends HistoryEntry> getHistoryEntries(BaseDO<?> ob) { long begin = System.currentTimeMillis(); HistoryService histservice = HistoryServiceManager.get().getHistoryService(); PfEmgrFactory emf = ApplicationContextProvider.getApplicationContext().getBean(PfEmgrFactory.class); List<? extends HistoryEntry> ret = emf.runInTrans((emgr) -> { return histservice.getHistoryEntries(emgr, ob); }); List<? extends HistoryEntry> nret = ret.stream() .sorted((e1, e2) -> e2.getModifiedAt().compareTo(e1.getModifiedAt())).collect(Collectors.toList()); long end = System.currentTimeMillis(); log.info("HistoryBaseDaoAdapter.getHistoryEntries took: " + (end - begin) + " ms."); return nret; }
public SimpleHistoryEntry(final UserGroupCache userGroupCache, final HistoryEntry entry) { this.timestamp = entry.getModifiedAt(); final Integer userId = NumberHelper.parseInteger(entry.getUserName()); if (userId != null) { this.user = userGroupCache.getUser(userId); } // entry.getClassName(); // entry.getComment(); this.entryType = entry.getEntityOpType(); // entry.getEntityId(); }
public DisplayHistoryEntry(final UserGroupCache userGroupCache, final HistoryEntry entry) { this.timestamp = entry.getModifiedAt(); final Integer userId = NumberHelper.parseInteger(entry.getUserName()); if (userId != null) { this.user = userGroupCache.getUser(userId); } // entry.getClassName(); // entry.getComment(); this.entryType = entry.getEntityOpType(); // entry.getEntityId(); }