/** * Checks to see if this object has been tagged with the given tag name. * * @param tagName the tag name to check * @return true if this eo is tagged with the given tag name, false otherwise */ public boolean isTaggedWith(String tagName) { return ERXQ.filtered(tags(), ERTag.NAME.is(tagName)).count() > 0; }
/** * This method removes tags from the target object, by looking up the corresponding * Tag object instances and removing them from the tag collection of the object if they exist. * * @param tagName the tag to remove (String to tokenize, NSArray<String>, etc) */ public void removeTagNamed(String tagName) { NSArray<ERTag> erTags = tags(); NSArray<ERTag> matchingTags = ERXQ.filtered(erTags, ERTag.NAME.is(tagName)); for (ERTag tag : matchingTags) { removeTag(tag); } }
/** * Checks to see if this object has been tagged with any of the given tags. * * @param tags the tags to add (String to tokenize, NSArray<String>, etc) * @return true if this eo is tagged with any of the given tag names, false otherwise */ public boolean isTaggedWithAny(Object tags) { NSArray<String> tagNames = _entity.splitTagNames(tags); return ERXQ.filtered(tags(), ERTag.NAME.in(tagNames)).count() > 0; }
/** * This method removes tags from the target object, by parsing the tags parameter * into Tag object instances and removing them from the tag collection of the object if they exist. * * @param tags the tags to remove (String to tokenize, NSArray<String>, etc) */ public void removeTags(Object tags) { NSArray<ERTag> erTags = tags(); NSArray<ERTag> matchingTags = ERXQ.filtered(erTags, ERTag.NAME.in(_entity.splitTagNames(tags))); for (ERTag tag : matchingTags) { removeTag(tag); } }
/** * Checks to see if this object has been tagged with all the given tags. * * @param tags the tags to add (String to tokenize, NSArray<String>, etc) * @return true if this eo is tagged with all of the given tag names, false otherwise */ public boolean isTaggedWithAll(Object tags) { NSArray<String> tagNames = _entity.splitTagNames(tags); return ERXQ.filtered(tags(), ERTag.NAME.in(tagNames)).count() == tagNames.count(); }
@SuppressWarnings("unchecked") public NSArray<EOEnterpriseObject> destinationObjectsWithQualifier(EOQualifier qual) { NSArray<EOEnterpriseObject> result = null; NSArray<EOSortOrdering> orderings = null; if (!ERXStringUtilities.stringIsNullOrEmpty(sortKey())) { orderings = ERXS.ascs(sortKey()); } if (extraQualifier() != null) { qual = ERXQ.and(qual, extraQualifier()); } if (useFetch() && ERXStringUtilities.stringIsNullOrEmpty(restrictedChoiceKey())) { if(restrictingFetchSpecificationName() != null) { qual = ERXQ.and(qual, restrictingFetchSpec().qualifier()); } EOFetchSpecification fetchSpec = new EOFetchSpecification(destinationEntityName(), qual, orderings); if (!ERXStringUtilities.stringIsNullOrEmpty((String) d2wContext() .valueForKey(Keys.fetchLimit))) { fetchSpec.setFetchLimit(Integer.valueOf((String) d2wContext() .valueForKey(Keys.fetchLimit))); } fetchSpec.setIsDeep(true); EOEditingContext ec = ERXEC.newEditingContext(); result = ec.objectsWithFetchSpecification(fetchSpec); } else { result = ERXQ.filtered(allItems(), qual); } return result; }