Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
These BIFs

Selector Built-in Functions

These functions are available via the object's namespace, e.g. Person:{function}.

They can be used to build up a complex selector for reading read sets of data from the persistence layer. These BIFs are accessed via the pseudo unit with the same name as the object that is being queried eg. “Person” or “Car”

TypeDescriptionallSimple allequalsEqualityemptyDetermine whether a variable is emptybetweenSelect a range of data between two valueslessThanOrEqual
Less or equals checklessThanCheck if value is less than the value being compared togreaterThan

The final four in the table below (union, diff, intersect, and and) can be used to build up a complex selector using a combination of other selector BIFs as parameters. The other selectors all take an object's attribute as first parameter, and one or more values as the next parameter(s).

FunctionSyntaxDescriptionExample
allObj:all()returns all records from the tablePerson[] plist = Person:all();
equalsObj:equals(a,b)

returns records with value of obj.a equal to b

Person[] plist = Person:equals(deleted, false);
notEqualsObj:notEquals(a,b)returns records with value of obj.a not equal to bPerson[] plist = Person:notEquals(deleted, true);
emptyObj:empty(a)returns records with obj.a equal to nullPerson[] plist = Person:empty(mobileNum);
betweenObj:between(a,x,y)returns records with value of obj.a within the range of values between x and yPerson[] plist = Person:between(dob, date1, date2);
lessThanOrEqual
Obj:lessThanOrEqual(a,b)returns records with value of obj.a less than or equal to bPerson[] plist = Person:lessThanOrEqual(age, num);
lessThanObj:lessThan(a,b)returns records with value of obj.a less than bPerson[] plist = Person:lessThan(age, num);
greaterThanObj:greaterThan(a,b)Check if value is greater than the value being compared toPerson[] plist = Person:greaterThan(age, num);
attributeInObj:attributeIn(a,"x,y,z")Attribute InPerson[] plist = Person:attributeIn(state, "Any, One, Of, These");
relationshipInObj:relationshipIn(a,b)Relationship InPerson[] plist = Person:relationshipIn(reportsTo, person);
containsObj:contains(a,b)Check is collection has element(s)Person[] plist = Person:contains(name, "a");
beginsWith Begin withPerson[] plist = Person:beginsWith(name, "a");
endsWith End with
notEqualsNot Equals
notEmptyNot empty
notBetweenPerson[] plist = Person:endsWith(name, "a");
notEmpty Not emptyPerson[] plist = Person:notEmpty(mobileNum);
notBetween Not between the data or elementsPerson[] plist = Person:notBetween(dob, date1, date2);
notContains Collection does not contain element(s)Person[] plist = Person:notContains(name, "a");
notBeginWith Not begin withPerson[] plist = Person:notBeginWith(name, "a");
notEndsWith Check if value does not end with value being compared toPerson[] plist = Person:notEndsWith(name, "a");
notAttributeIn Attribute not in the given domainPerson[] plist = Person:notAttributeIn(state, "Any, One, Of, These");
notRelationshipIn Use to check for relationshipPerson[] plist = Person:notRelationshipIn(reportsTo, person);
union UnionPerson[] plist = Person:union(equals(rating, "good"), equals(rating, "excellent"));
diff Use to check for differencesPerson[] plist = Person:diff(equals(), equals());
intersect IntersectPerson[] plist = Person:intersect(equals(deleted, false), equals(active, true));
and And (in most cases, use this rather than intersect)Person[] plist = Person:and(equals(deleted, false)
These BIFs perform operations on single persistent entities. They are accessed via a method call on a variable holding an object instance or on the pseudo unit with the same name as the object that the method is being performed on
, equals(active, true));

 

 

 

 

Data Subsets

Having populated a collection with a selector BIF, you can further refine your selection by assigning a subset of said collection to a new collection by using the select BIF. This BIF is available via the collection variable and takes one or a combination of the above selector BIFs as parameter. See the Collections for details.

 

 

Additional Mentions and References

 

 

Excerpt
hiddentrue

 all, equals, notEquals, etc. | select