HttpServletResponse response)
throws Throwable {
EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
AdminBean adminBean = getAdminBean(request);
Site site = adminBean.getSite();
JSONEscapeObject jsonResult = new JSONEscapeObject();
CustomAttributeMaintActionForm form = (CustomAttributeMaintActionForm) actionForm;
String customAttribOptionIds[] = form.getCustomAttribOptionIds();
if (customAttribOptionIds != null) {
for (int i = 0; i < customAttribOptionIds.length; i++) {
CustomAttributeOption customAttribOption = CustomAttributeOptionDAO.load(site.getSiteId(), Format.getLong(customAttribOptionIds[i]));
String sql = "select count(*) " +
"from ItemAttributeDetail itemAttributeDetail " +
"where itemAttributeDetail.customAttributeOption = :customAttributeOption ";
Query query = em.createQuery(sql);
query.setParameter("customAttributeOption", customAttribOption);