/* * Adding a new Shipping Address */ public void addAddress(AddressVO addAddressBean, String userId) throws SapeStoreException { // addAddressBean.setAddressId(123456); LOGGER.debug(" AddressDao.addNewAddress method: START"); try { Address address = new Address(); address.setAddressId(addAddressBean.getAddressId()); address.setUserId(userId); address.setStateId(addAddressBean.getStateId()); address.setCityId(addAddressBean.getCityId()); address.setCountryId(addAddressBean.getCountryId()); address.setAddressLine1(addAddressBean.getAddressLine1()); address.setAddressLine2(addAddressBean.getAddressLine2()); address.setPostalCode(addAddressBean.getPostalCode()); address.setCreatedDate(new java.util.Date()); address.setUpdatedDate(new java.util.Date()); address.setPhone(addAddressBean.getPhone()); address.setIsActive(addAddressBean.getIsActive()); address.setName(addAddressBean.getName()); hibernateTemplate.save(address); LOGGER.debug(" Address is added "); } catch (SapeStoreSystemException se) { LOGGER.fatal("A DB exception occured while inserting the address's information", se); } LOGGER.debug(" AddressDao.addNewAddresss method: END "); }
@Override public void addAddress(AddressVO address, String userId) { try { address.setCountryId(1); address.setIsActive("y"); addressDao.addAddress(address, userId); } catch (SapeStoreException e) { // TODO Auto-generated catch block e.printStackTrace(); } }