query.setParameter("siteId", siteId);
query.setParameter("shippingRegionName", Constants.SHIPPINGREGION_OTHERS);
iterator = query.getResultList().iterator();
Vector<ShippingRegion> srVector = new Vector<ShippingRegion>();
while (iterator.hasNext()) {
ShippingRegion shippingRegion = (ShippingRegion) iterator.next();
srVector.add(shippingRegion);
JSONEscapeObject JSONEscapeObject = new JSONEscapeObject();
JSONEscapeObject.put("shippingRegionId", shippingRegion.getShippingRegionId().toString());
JSONEscapeObject.put("shippingRegionName", shippingRegion.getShippingRegionName());
jsonShippingRegions.add(JSONEscapeObject);
}
sql = "from ShippingRegion shippingRegion where shippingRegion.site.siteId = :siteId and shippingRegionName != :shippingRegionName order by shippingRegionName";
query = em.createQuery(sql);
query.setParameter("siteId", siteId);
query.setParameter("shippingRegionName", Constants.SHIPPINGREGION_OTHERS);
iterator = query.getResultList().iterator();
srVector = new Vector<ShippingRegion>();
while (iterator.hasNext()) {
ShippingRegion shippingRegion = (ShippingRegion) iterator.next();
srVector.add(shippingRegion);
JSONEscapeObject JSONEscapeObject = new JSONEscapeObject();
JSONEscapeObject.put("shippingRegionId", shippingRegion.getShippingRegionId().toString());
JSONEscapeObject.put("shippingRegionName", shippingRegion.getShippingRegionName());
boolean published = false;
for (ShippingMethodRegion shippingMethodRegion : shippingMethod.getShippingMethodRegions()) {
if (shippingMethodRegion.getShippingRegion().getShippingRegionId().equals(shippingRegion.getShippingRegionId())) {
if (shippingMethodRegion.getPublished() == Constants.VALUE_YES) {
published = true;
break;
}
}
}
JSONEscapeObject.put("published", published);
jsonShippingRegions.add(JSONEscapeObject);
}
ShippingRegion shippingRegions[] = new ShippingRegion[srVector.size()];
srVector.toArray(shippingRegions);
Vector<JSONEscapeObject> jsonShippingTypes = new Vector<JSONEscapeObject>();
for (int i = 0; i < shippingTypes.length; i++) {
JSONEscapeObject JSONEscapeObject = new JSONEscapeObject();