@SuppressWarnings("unused")
public Template get(String id){
if (id == null || id.equals("")) {
return null;
}
Template tmp = null;
Object template = EhcacheHandler.getInstance().get(EhcacheHandler.FOREVER_CACHE,id);
if (template != null){
if (template instanceof Template) {
tmp = (Template)template;
}
}
else{
tmp = new TemplateAccessSessionMySQL().queryTemplateById(DataAccessFactory.getInstance().createUUID(id));
if (tmp != null) {
EhcacheHandler.getInstance().set(EhcacheHandler.FOREVER_CACHE,tmp.getId().getValue(), tmp);
}
}
if (tmp == null) {
logger.error("template is not in cache!");