2829303132333435
if (entity.getId() == null) { entity.setId(generateSessionInfoId()); } String key = createSessionKey(entity.getId()); entity.transform(); this.cache.put(key , new EntityHolder(key, entity) ); return entity; }
6364656667686970717273
private String safeId(Number id) { return String.valueOf(id); //TODO } public SessionInfo findSessionInfo(Integer id) { EntityHolder holder = (EntityHolder) this.cache.get( createSessionKey(id) ); if (holder == null) { return null; } return holder.getSessionInfo(); }
979899100101102103104
if (workItemInfo.getId() == null) { workItemInfo.setId(generateWorkItemInfoId()); } String key = createWorkItemKey(workItemInfo.getId()); workItemInfo.transform(); cache.put(key, new EntityHolder(key, workItemInfo)); return workItemInfo; }
102103104105106107108109110111112
cache.put(key, new EntityHolder(key, workItemInfo)); return workItemInfo; } public WorkItemInfo findWorkItemInfo(Long id) { EntityHolder holder = (EntityHolder) cache.get(createWorkItemKey(id)); if (holder == null) { return null; } return holder.getWorkItemInfo(); }
117118119120121122123
} public WorkItemInfo merge(WorkItemInfo workItemInfo) { String key = createWorkItemKey(workItemInfo.getId()); workItemInfo.transform(); return ((EntityHolder) cache.put(key, new EntityHolder(key, workItemInfo))).getWorkItemInfo(); }