public boolean _isPrimaryKeyClassProperty() { NSArray pkAtts = _parent_primaryKeyAttributes(); if (pkAtts == null) return false; if (!pkAtts.containsObject(this)) return false; return _parent.classProperties().containsObject(this); }
public void addObjectToBothSidesOfLogEntryRelationshipWithKey(EOEnterpriseObject object, String key) { // if we said insertionLogEntry=null in validateForInsert, we run the risk of // the save failing and the user making a modif, which then would not be // propagated to the log entry. if (insertionLogEntry!=null && editingContext().insertedObjects().containsObject(this)) insertionLogEntry.addObjectToBothSidesOfRelationshipWithKey(object,key); }
public int displayLevelForEvent(EOEvent e) { int index, i, n; NSArray children; index = selectionPath.indexOfObject(e); if (index != NSArray.NotFound) return index; children = rootEventList(); if (children.containsObject(e)) return 0; int count = selectionPath.count(); for (i = 0, n = count; i < n; i++) { children = (NSArray)cache.objectForKey(selectionPath.objectAtIndex(i)); if (null==children) break; if (children.containsObject(e)) return i+1; } return -1; }
protected void handleUpdate(EOEditingContext ec, EOEnterpriseObject eo) { NSArray keys = configuration.objectForKey(eo.entityName()).keys; NSDictionary committedSnapshotForObject = ec.committedSnapshotForObject(eo); NSDictionary changes = eo.changesFromSnapshot(committedSnapshotForObject); for (Enumeration e1 = changes.keyEnumerator(); e1.hasMoreElements();) { String key = (String) e1.nextElement(); if (keys.containsObject(key)) { handleUpdate(ec, eo, key, committedSnapshotForObject.objectForKey(key), changes.objectForKey(key)); } } }
public void setPossibleValuesUseType(String v) { _mustSearchForLookup = false; _isPreset = false; if(v == null) { _possibleValuesUseType = null; } else { if (!_possibleUseTypes.containsObject(v)) { // invalid possibleValuesUseType log.error("Invalid possibleValuesUseType: {}. Allowed are only: {} {}", v, _possibleUseTypes, this); _possibleValuesUseType = null; } else { _possibleValuesUseType = v; _mustSearchForLookup = useRange() || usePeriodic(); _isPreset = useRange() || usePredefined(); _isPeriodic = usePeriodic(); } } }
public boolean validationExceptionOccurredForPropertyKey() { if (d2wContext().propertyKey() == null) { return false; } else { String propertyKey = d2wContext().propertyKey(); boolean contains = keyPathsWithValidationExceptions().containsObject(propertyKey); return contains; } }
public String chartType() { if(_chartType == null) { _chartType = (String)valueForBinding("chartType"); ERXAssert.DURING.notNull("chartType", _chartType); ERXAssert.DURING.isTrue("chartType "+_chartType +" is not in supported types: " + supportedTypes(), supportedTypes().containsObject(_chartType)); } return _chartType; }
String key = (String) e.nextElement(); Object jsonValue; if(cd.toManyRelationshipKeys().containsObject(key)) { if (relationshipNames.containsObject(key)) { Object value = source.valueForKey(key); jsonValue = ser.marshall(state, source, value, key); } else if (cd.toOneRelationshipKeys().containsObject(key)) { if (relationshipNames.containsObject(key)) { Object value = source.valueForKey(key); jsonValue = ser.marshall(state, source, value, key);
Object value = eoDict.get(key); Object obj = ser.unmarshall(state, null, value); if (attributeNames.containsObject(key)) { if (obj == null && !relationshipNames.containsObject(key) && (eo.toOneRelationshipKeys().containsObject(key) || eo.toManyRelationshipKeys().containsObject(key))) {
/** * Validates the given sort key (is it a display key, an attribute, or a valid attribute path). * * @param displayPropertyKeys the current display properties * @param sortKey the sort key to validate * @return true if the sort key is valid, false if not */ protected boolean isValidSortKey(NSArray<String> displayPropertyKeys, String sortKey) { boolean validSortOrdering = false; try { if (displayPropertyKeys.containsObject(sortKey) || entity().anyAttributeNamed(sortKey) != null || ERXEOAccessUtilities.attributePathForKeyPath(entity(), sortKey).count() > 0) { validSortOrdering = true; } } catch (IllegalArgumentException e) { // MS: ERXEOAccessUtilities.attributePathForKeyPath throws IllegalArgumentException for a bogus key path validSortOrdering = false; } if (!validSortOrdering) { log.warn("Sort key '" + sortKey + "' is not in display keys, attributes or non-flattened key paths for the entity '" + entity().name() + "'."); validSortOrdering = false; } return validSortOrdering; }
/** * This method applies tags to the target object, by parsing the tags parameter * into Tag object instances and adding them to the tag collection of the object. * If the tag name already exists in the tags table, it just adds a relationship * to the existing tag record. If it doesn't exist, it then creates a new * Tag record for it. * * @param tags the tags to add (String to tokenize, NSArray<String>, etc) * @param clear if true, existing tags will be removed first */ public void addTags(boolean clear, Object tags) { // clear the collection if appropriate if (clear) { clearTags(); } NSArray<ERTag> erTags = tags(); EOEditingContext editingContext = _item.editingContext(); // append the tag names to the collection for (String tagName : _entity.splitTagNames(tags)) { // ensure that tag names don't get duplicated ERTag tag = _entity.fetchTagNamed(editingContext, tagName, true); if (!erTags.containsObject(tag)) { addTag(tag); } } }
@Override public void validateForUpdate() { if (_componentChanged && component()!=null && !_ownerChanged) { setOwner(component().owner()); } _componentChanged=false; _ownerChanged=false; super.validateForUpdate(); if(!(changesFromCommittedSnapshot().count() == 1 && changesFromCommittedSnapshot().allKeys().containsObject(Key.IS_READ))) { touch(); } }
if (source.classPropertyNames().containsObject(key)) { value = eo.valueForKey(key); } else {