private List getTextAttributeValues(boolean quickSearchOnly) throws Exception { SequencedHashMap searchValues = getCommonAttributeValuesMap(); List searchAttributes = new ArrayList(searchValues.size()); for ( int i=0; i<searchValues.size(); i++ ) { AttributeValue searchValue = (AttributeValue)searchValues.getValue(i); if ( (!quickSearchOnly || searchValue.isQuickSearchAttribute()) && searchValue.getAttribute().isTextAttribute() ) { searchAttributes.add(searchValue); } } return searchAttributes; }
/** * Returns OptionAttributes which have been marked for Quick search. * * @return a <code>List</code> value * @exception Exception if an error occurs */ private List getOptionAttributeValues(boolean quickSearchOnly) throws Exception { SequencedHashMap searchValues = getCommonAttributeValuesMap(); List searchAttributeValues = new ArrayList(searchValues.size()); for ( int i=0; i<searchValues.size(); i++ ) { AttributeValue searchValue = (AttributeValue)searchValues.getValue(i); if ( (!quickSearchOnly || searchValue.isQuickSearchAttribute()) && searchValue instanceof OptionAttribute ) { searchAttributeValues.add(searchValue); } } return searchAttributeValues; }
private void initTransientState() { executions = new ArrayList(50); batchLoadableEntityKeys = new SequencedHashMap(30); loadingCollections = new HashMap(); nonlazyCollections = new ArrayList(20); batcher = factory.isJdbcBatchUpdateEnabled() ? (Batcher) new BatchingBatcher(this) : (Batcher) new NonBatchingBatcher(this); }
public static java.util.Map getParameterTypes(Element queryElem) { java.util.Map result = new SequencedHashMap(); Iterator iter = queryElem.elementIterator("query-param"); while ( iter.hasNext() ) { Element element = (Element) iter.next(); result.put( element.attributeValue("name"), element.attributeValue("type") ); } return result; }
/** * Gathers the pk fields from the hierarchy of the given class, and copies them into the class. * * @param classDef The root of the hierarchy * @throws ConstraintException If there is a conflict between the pk fields */ private void ensurePKsFromHierarchy(ClassDescriptorDef classDef) throws ConstraintException { SequencedHashMap pks = new SequencedHashMap(); for (Iterator it = classDef.getAllExtentClasses(); it.hasNext();) { ClassDescriptorDef subTypeDef = (ClassDescriptorDef)it.next(); ArrayList subPKs = subTypeDef.getPrimaryKeys(); // check against already present PKs for (Iterator pkIt = subPKs.iterator(); pkIt.hasNext();) { FieldDescriptorDef fieldDef = (FieldDescriptorDef)pkIt.next(); FieldDescriptorDef foundPKDef = (FieldDescriptorDef)pks.get(fieldDef.getName()); if (foundPKDef != null) { if (!isEqual(fieldDef, foundPKDef)) { throw new ConstraintException("Cannot pull up the declaration of the required primary key "+fieldDef.getName()+ " because its definitions in "+fieldDef.getOwner().getName()+" and "+ foundPKDef.getOwner().getName()+" differ"); } } else { pks.put(fieldDef.getName(), fieldDef); } } } ensureFields(classDef, pks.values()); }
/** * Describe <code>containsMinimumAttributeValues</code> method here. * * @return a <code>boolean</code> value * @exception Exception if an error occurs */ public boolean containsMinimumAttributeValues() throws Exception { List attributes = getModule() .getRequiredAttributes(getIssueType()); boolean result = true; SequencedHashMap avMap = getModuleAttributeValuesMap(); Iterator i = avMap.iterator(); while (i.hasNext()) { AttributeValue aval = (AttributeValue)avMap.get(i.next()); if ( aval.getOptionId() == null && aval.getValue() == null ) { for ( int j=attributes.size()-1; j>=0; j-- ) { if ( aval.getAttribute().getPrimaryKey().equals( ((Attribute)attributes.get(j)).getPrimaryKey() )) { result = false; break; } } if ( !result ) { break; } } } return result; }
public SequencedHashMap getCommonAttributeValuesMap() throws Exception { SequencedHashMap result = null; if (isXMITSearch()) { result = getMITAttributeValuesMap(); } else { result = super.getModuleAttributeValuesMap(); } return result; }
/** * Return a new instance of this class, with iteration * order defined by the order that entries were added */ public static Map instantiateSequenced(int size) { return new IdentityMap( new SequencedHashMap(size) ); }