siteDomain.setRecCreateBy(userId);
siteDomain.setRecCreateDatetime(new Date(System.currentTimeMillis()));
siteDomain.setBaseCurrency(siteCurrencyClass);
siteDomain.setSite(site);
Template template = new Template();
template.setSite(site);
template.setTemplateName(Constants.TEMPLATE_BASIC);
template.setTemplateDesc("Basic template");
template.setRecUpdateBy(userId);
template.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
template.setRecCreateBy(userId);
template.setRecCreateDatetime(new Date(System.currentTimeMillis()));
em.persist(template);
siteDomain.setTemplate(template);
em.persist(siteDomain);