public AjaxTreeModel() { _expandedTreeNodes = new NSMutableSet(); _collapsedTreeNodes = new NSMutableSet(); _delegate = new _NSDelegate(AjaxTreeModel.Delegate.class); }
protected NSArray indexableObjectsForObjects(String type, NSArray<EOEnterpriseObject> objects) { NSMutableSet<EOEnterpriseObject> result = new NSMutableSet(); for (EOEnterpriseObject eo : objects) { NSArray targetObjects = indexableObjectsForObject(type, eo); result.addObjectsFromArray(targetObjects); } return result.allObjects(); }
NSMutableSet<Object> mergeConstructors = new NSMutableSet<Object>(ourConstructors); mergeConstructors.unionSet(new NSSet<Object>(ourDeclaredConstructors)); Object[] allOurConstructors = mergeConstructors._allObjects(); NSMutableSet<Object> mergeFields = new NSMutableSet <Object>(ourFields); mergeFields.unionSet(new NSSet <Object> (ourDeclaredFields)); Object[] allOurFields = mergeFields._allObjects(); NSMutableSet<Object> mergeMethods = new NSMutableSet<Object>(ourMethods); mergeMethods.unionSet(new NSSet <Object>(ourDeclaredMethods)); Object[] allOurMethods = mergeMethods._allObjects();
abset = new NSMutableSet();
NSMutableSet<String> tagNames = new NSMutableSet<>(); if (tags != null) { if (tags instanceof String) {
private NSSet<EOEntity> _relatedEntities(EOEntity entity) { NSMutableSet<EOEntity> entities = new NSMutableSet<>(); for (EOAttribute attrib : entity.attributesToFetch()) { if (attrib.isDerived()) { attrib = entity._attributeForPath(attrib.definition()); if (attrib != null) entities.add(attrib.entity()); } } // for (EORelationship rel : (NSArray<EORelationship>) entity._hiddenRelationships()) { // entities.add(rel.destinationEntity()); // } return entities; } }
public ERAutoIndex(String name, NSDictionary indexDef) { super(name); // Ensures that the first instance of ERAutoIndex creates the singleton thread // for processing the queue of transactions synchronized (ERIndex.class) { if (_queue == null) { _queue = new ERXAsyncQueue<Transaction>() { @Override public void process(Transaction transaction) { transaction.handler().index(transaction); } }; // Set the name of the thread _queue.setName(KEY); // Start the thread _queue.start(); } } _entities = new NSMutableSet(); _configuration.initFromDictionary(indexDef); setTransactionHandler(new AutoTransactionHandler()); }
@Override public NSArray<EOSQLExpression> dropPrimaryKeySupportStatementsForEntityGroup(NSArray<EOEntity> entityGroup) { NSMutableSet<String> sequenceNames = new NSMutableSet<String>(entityGroup.count()); NSMutableArray<EOSQLExpression> results = new NSMutableArray<EOSQLExpression>(); for (EOEntity entity : entityGroup) { String sequenceName = H2PlugIn._sequenceNameForEntity(entity); if (!sequenceNames.containsObject(sequenceName)) { sequenceNames.addObject(sequenceName); String sql = "DROP SEQUENCE " + sequenceName; results.addObject(createExpression(entity, sql)); } } return results; }
public NSArray<String> terms(String fieldName) { NSMutableSet<String> result = new NSMutableSet(); TermEnum terms = null; try { IndexReader reader = indexReader(); terms = reader.terms(new Term(fieldName, "")); while (fieldName.equals(terms.term().field())) { result.addObject(terms.term().text()); if (!terms.next()) { break; } } } catch (IOException e) { throw NSForwardException._runtimeExceptionForThrowable(e); } finally { if (terms != null) { try { terms.close(); } catch (IOException e) { throw NSForwardException._runtimeExceptionForThrowable(e); } } } return result.allObjects(); }
NSMutableSet<EOEnterpriseObject> deletedHandledObjects = new NSMutableSet<>(); NSMutableSet<EOEnterpriseObject> addedHandledObjects = new NSMutableSet<>();
protected NSArray indexableObjectsForObject(String type, EOEnterpriseObject object) { ERXGenericRecord eo = (ERXGenericRecord) object; EOEditingContext ec = eo.editingContext(); NSMutableSet<EOEnterpriseObject> result = new NSMutableSet(); String entityName = eo.entityName(); ConfigurationEntry config = _configuration.entryForKey(entityName);
@Override public NSArray<EOSQLExpression> primaryKeySupportStatementsForEntityGroup(NSArray<EOEntity> entityGroup) { NSMutableSet<String> sequenceNames = new NSMutableSet<String>(); NSMutableArray<EOSQLExpression> results = new NSMutableArray<EOSQLExpression>(); for (EOEntity entity : entityGroup) { if (isPrimaryKeyGenerationNotSupported(entity)) { continue; } EOAttribute priKeyAttribute = entity.primaryKeyAttributes().objectAtIndex(0); String sql; String sequenceName = H2PlugIn._sequenceNameForEntity(entity); if (!sequenceNames.containsObject(sequenceName)) { sequenceNames.addObject(sequenceName); // timc 2006-11-06 create result here so we can check for // enableIdentifierQuoting while building the statement H2Expression result = new H2Expression(entity); String attributeName = result.sqlStringForAttribute(priKeyAttribute); String tableName = result.sqlStringForSchemaObjectName(entity.externalName()); sql = "CREATE SEQUENCE " + sequenceName + " START WITH (SELECT MAX(" + attributeName + ") + 1 FROM " + tableName + ")"; results.addObject(createExpression(entity, sql)); sql = "ALTER TABLE " + tableName + " ALTER COLUMN " + attributeName + " SET DEFAULT nextval('" + sequenceName + "')"; results.addObject(createExpression(entity, sql)); } } return results; }