shippingMethodRegion.setShippingRegion(shippingRegion);
if (m_shippingMethodRegion.getShippingMethodRegionTypes() != null) {
Iterator<?> it1 = m_shippingMethodRegion.getShippingMethodRegionTypes().iterator();
while (it1.hasNext()) {
ShippingMethodRegionType m_shippingMethodRegionType = (ShippingMethodRegionType) it1.next();
ShippingMethodRegionType shippingMethodRegionType = new ShippingMethodRegionType();
shippingMethodRegionType.setPublished(m_shippingMethodRegionType.getPublished());
shippingMethodRegionType.setRecUpdateBy(userId);
shippingMethodRegionType.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
shippingMethodRegionType.setRecCreateBy(userId);
shippingMethodRegionType.setRecCreateDatetime(new Date(System.currentTimeMillis()));
shippingMethodRegionType.setShippingRegion(shippingRegion);
shippingMethodRegionType.setShippingMethod(shippingMethod);
shippingMethodRegionType.setShippingType(getShippingType(m_shippingMethodRegionType.getShippingType().getShippingTypeName()));
ShippingRate m_shippingRate = m_shippingMethodRegionType.getShippingRate();
ShippingRate shippingRate = new ShippingRate();
PropertyUtils.copyProperties(shippingRate, m_shippingRate);
shippingRate.setPublished(m_shippingRate.getPublished());
shippingRate.setRecUpdateBy(userId);
shippingRate.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
shippingRate.setRecCreateBy(userId);
shippingRate.setRecCreateDatetime(new Date(System.currentTimeMillis()));
shippingMethodRegionType.setShippingRate(shippingRate);
em.persist(shippingRate);
em.persist(shippingMethodRegionType);
shippingMethodRegion.getShippingMethodRegionTypes().add(shippingMethodRegionType);
}