}
@Override
public void readForm(PageStandardForm form, ActionMessages errors, HttpServletRequest request)
{
CompanyVO company = (CompanyVO) getPanel().getAttribute("company");
if (log.isDebugEnabled())
log.debug("save button pressed");
company.setCompanyName(form.getCompanyName());
company.setUrl(form.getUrl());
company.setPhone(form.getPhone());
company.setFax(form.getFax());
company.setEmail(form.getEmail());
company.setComment(form.getComment());
if (form.getStaffCount() != null)
company.setStaffCount(new Integer(form.getStaffCount()));
else
company.setStaffCount(null);
try
{
if(form.getSectorId() > 0) {
if(isEntityChanged(form.getSectorId(), company.getSector()))
company.setSector(new SectorDAO().getById(form.getSectorId()));
} else {
company.setSector(null);
}
if(form.getLegalFormId() > 0) {
if(isEntityChanged(form.getLegalFormId(), company.getLegalForm()))
company.setLegalForm(new LegalFormDAO().getById(form.getLegalFormId()));
} else {
company.setLegalForm(null);
}
if(form.getCompanyTypeId() > 0) {
if(isEntityChanged(form.getCompanyTypeId(), company.getCompanyType()))
company.setCompanyType(new CompanyTypeDAO().getById(form.getCompanyTypeId()));
} else {
company.setCompanyType(null);
}
if(form.getCompanyStateId() > 0) {
if(isEntityChanged(form.getCompanyStateId(), company.getCompanyState()))
company.setCompanyState(new CompanyStateDAO().getById(form.getCompanyStateId()));
} else {
company.setCompanyState(null);
}
if(form.getCategoryId() > 0) {
if(isEntityChanged(form.getCategoryId(), company.getCategory()))
company.setCategory(new CategoryDAO().getById(form.getCategoryId()));
} else {
company.setCategory(null);
}
if(form.getRatingId() > 0) {
if(isEntityChanged(form.getRatingId(), company.getRating()))
company.setRating(new RatingDAO().getById(form.getRatingId()));
} else {
company.setRating(null);
}
}
catch (HibernateException e)
{