}
}
}
if (orderHeader.getCustAddress() != null) {
OrderAddress custAddress = orderHeader.getCustAddress();
if (custAddress.getRecCreateBy() == null) {
custAddress.setRecCreateBy(userId);
custAddress.setRecCreateDatetime(current);
}
custAddress.setRecUpdateBy(userId);
custAddress.setRecUpdateDatetime(current);
if (orderHeader.getCustAddress().getOrderAddressId() == null) {
em.persist(orderHeader.getCustAddress());
}
}
if (orderHeader.getShippingAddress() != null) {
OrderAddress shippingAddress = orderHeader.getShippingAddress();
if (shippingAddress.getRecCreateBy() == null) {
shippingAddress.setRecCreateBy(userId);
shippingAddress.setRecCreateDatetime(current);
}
shippingAddress.setRecUpdateBy(userId);
shippingAddress.setRecUpdateDatetime(current);
if (orderHeader.getShippingAddress().getOrderAddressId() == null) {
em.persist(orderHeader.getShippingAddress());
}
}
if (orderHeader.getBillingAddress() != null) {
OrderAddress billingAddress = orderHeader.getBillingAddress();
if (billingAddress.getRecCreateBy() == null) {
billingAddress.setRecCreateBy(userId);
billingAddress.setRecCreateDatetime(current);
}
billingAddress.setRecUpdateBy(userId);
billingAddress.setRecUpdateDatetime(current);
if (orderHeader.getBillingAddress().getOrderAddressId() == null) {
em.persist(orderHeader.getBillingAddress());
}
}