"Category combo " + catCombo.getName() + " must have " + categoryMap.get( category ).getName() );
private Map<String, Category> getCodeCategoryMap( CategoryCombo categoryCombo ) throws AdxException { Map<String, Category> categoryMap = new HashMap<>(); List<Category> categories = categoryCombo.getCategories(); for ( Category category : categories ) { String categoryCode = category.getCode(); if ( categoryCode == null || !XMLChar.isValidName( categoryCode ) ) { throw new AdxException( "Category code for " + category.getName() + " is missing or invalid: " + categoryCode ); } categoryMap.put( category.getCode(), category ); } return categoryMap; }
@Override public String getCreateTempTableStatement() { String statement = "create table " + getTempTableName() + " (" + "categoryoptioncomboid integer not null, " + "categoryoptioncomboname varchar(255), "; for ( Category category : objects ) { quote( category.getName() ); statement += quote( category.getName() ) + " varchar(230), "; statement += quote( category.getUid() ) + " character(11), "; } for ( CategoryOptionGroupSet groupSet : groupSets ) { statement += quote( groupSet.getName() ) + " varchar(230), "; statement += quote( groupSet.getUid() ) + " character(11), "; } statement += "primary key (categoryoptioncomboid))"; return statement; }
private void addExplodedCategoryAttributes( CategoryOptionCombo coc ) throws AdxException { Map<String, String> categoryAttributes = new HashMap<>(); if ( !coc.isDefault() ) { for ( Category category : coc.getCategoryCombo().getCategories() ) { String categoryCode = category.getCode(); if ( categoryCode == null || !XMLChar.isValidName( categoryCode ) ) { throw new AdxException( "Category code for " + category.getName() + " is missing or invalid: " + categoryCode ); } String catOptCode = category.getCategoryOption( coc ).getCode(); if ( catOptCode == null || catOptCode.isEmpty() ) { throw new AdxException( "CategoryOption code for " + category.getCategoryOption( coc ).getName() + " is missing" ); } categoryAttributes.put( categoryCode, catOptCode ); } } categoryOptionMap.put( coc.getId(), categoryAttributes ); }
throw new CategoryComboMapException( "No categoryOption in " + category.getName() + " matching " + optionCombo.getName() );
"where coc.categoryoptioncomboid = cocco.categoryoptioncomboid " + "and cco.categoryid = " + category.getId() + " " + "limit 1) as " + quote( category.getName() ) + ", ";