}
}
protected com.liferay.portal.model.Company update(
com.liferay.portal.model.Company company) throws SystemException {
Session session = null;
try {
if (company.isNew() || company.isModified()) {
session = openSession();
if (company.isNew()) {
CompanyHBM companyHBM = new CompanyHBM(company.getCompanyId(),
company.getKey(), company.getPortalURL(),
company.getHomeURL(), company.getMx(),
company.getName(), company.getShortName(),
company.getType(), company.getSize(),
company.getStreet(), company.getCity(),
company.getState(), company.getZip(),
company.getPhone(), company.getFax(),
company.getEmailAddress(), company.getAuthType(),
company.getAutoLogin(), company.getStrangers());
session.save(companyHBM);
session.flush();
}
else {
try {
CompanyHBM companyHBM = (CompanyHBM)session.load(CompanyHBM.class,
company.getPrimaryKey());
companyHBM.setKey(company.getKey());
companyHBM.setPortalURL(company.getPortalURL());
companyHBM.setHomeURL(company.getHomeURL());
companyHBM.setMx(company.getMx());
companyHBM.setName(company.getName());
companyHBM.setShortName(company.getShortName());
companyHBM.setType(company.getType());
companyHBM.setSize(company.getSize());
companyHBM.setStreet(company.getStreet());
companyHBM.setCity(company.getCity());
companyHBM.setState(company.getState());
companyHBM.setZip(company.getZip());
companyHBM.setPhone(company.getPhone());
companyHBM.setFax(company.getFax());
companyHBM.setEmailAddress(company.getEmailAddress());
companyHBM.setAuthType(company.getAuthType());
companyHBM.setAutoLogin(company.getAutoLogin());
companyHBM.setStrangers(company.getStrangers());
session.flush();
}
catch (ObjectNotFoundException onfe) {
CompanyHBM companyHBM = new CompanyHBM(company.getCompanyId(),
company.getKey(), company.getPortalURL(),
company.getHomeURL(), company.getMx(),
company.getName(), company.getShortName(),
company.getType(), company.getSize(),
company.getStreet(), company.getCity(),
company.getState(), company.getZip(),
company.getPhone(), company.getFax(),
company.getEmailAddress(),
company.getAuthType(), company.getAutoLogin(),
company.getStrangers());
session.save(companyHBM);
session.flush();
}
}
company.setNew(false);
company.setModified(false);