}
}
protected com.liferay.portal.model.Address update(
com.liferay.portal.model.Address address) throws SystemException {
Session session = null;
try {
if (address.isNew() || address.isModified()) {
session = openSession();
if (address.isNew()) {
AddressHBM addressHBM = new AddressHBM(address.getAddressId(),
address.getCompanyId(), address.getUserId(),
address.getUserName(), address.getCreateDate(),
address.getModifiedDate(), address.getClassName(),
address.getClassPK(), address.getDescription(),
address.getStreet1(), address.getStreet2(),
address.getCity(), address.getState(),
address.getZip(), address.getCountry(),
address.getPhone(), address.getFax(),
address.getCell(), address.getPriority());
session.save(addressHBM);
session.flush();
}
else {
try {
AddressHBM addressHBM = (AddressHBM)session.load(AddressHBM.class,
address.getPrimaryKey());
addressHBM.setCompanyId(address.getCompanyId());
addressHBM.setUserId(address.getUserId());
addressHBM.setUserName(address.getUserName());
addressHBM.setCreateDate(address.getCreateDate());
addressHBM.setModifiedDate(address.getModifiedDate());
addressHBM.setClassName(address.getClassName());
addressHBM.setClassPK(address.getClassPK());
addressHBM.setDescription(address.getDescription());
addressHBM.setStreet1(address.getStreet1());
addressHBM.setStreet2(address.getStreet2());
addressHBM.setCity(address.getCity());
addressHBM.setState(address.getState());
addressHBM.setZip(address.getZip());
addressHBM.setCountry(address.getCountry());
addressHBM.setPhone(address.getPhone());
addressHBM.setFax(address.getFax());
addressHBM.setCell(address.getCell());
addressHBM.setPriority(address.getPriority());
session.flush();
}
catch (ObjectNotFoundException onfe) {
AddressHBM addressHBM = new AddressHBM(address.getAddressId(),
address.getCompanyId(), address.getUserId(),
address.getUserName(), address.getCreateDate(),
address.getModifiedDate(),
address.getClassName(), address.getClassPK(),
address.getDescription(), address.getStreet1(),
address.getStreet2(), address.getCity(),
address.getState(), address.getZip(),
address.getCountry(), address.getPhone(),
address.getFax(), address.getCell(),
address.getPriority());
session.save(addressHBM);
session.flush();
}
}
address.setNew(false);
address.setModified(false);