}
public static void setCacheText(Site site, String cacheKey, char cacheTypeCode, String cacheValue) throws Exception {
EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
Cache cache = loadByKey(site.getSiteId(), cacheKey);
boolean exist = true;
if (cache == null) {
cache = new Cache();
exist = false;
cache.setCacheTypeCode(cacheTypeCode);
cache.setRecCreateBy(Constants.USERNAME_SYSTEM);
cache.setRecCreateDatetime(new Date());
}
cache.setSite(site);
cache.setCacheKey(cacheKey);
cache.setCacheText(cacheValue);
cache.setRecUpdateBy(Constants.USERNAME_SYSTEM);
cache.setRecUpdateDatetime(new Date());
if (!exist) {
em.persist(cache);
}
}