Find Expressions removed
In 9.0, the Gosu language no longer supports
find expressions. Gosu
retains equivalent functionality for retrieving information from the
application database with the query builder APIs. Configuration upgrade
tools for Version 9.0 convert legacy find
expressions to equivalent query builder code.
For example, the find expression in the following
example Gosu code from earlier versions of PolicyCenter returns Address instances that are located
in the city of Chicago.
// Query the database for addresses in Chicago.
var findQuery = find (a in Address where (a.City == "Chicago"))
// Print the addresses in the query result.
for (a in findQuery) {
print (a.AddressLine1 + " / " + a.City + ", " + a.PostalCode)
}
After upgrade, the preceding find expression is converted to
the following query builder code, which also returns addresses that are
located in the city of Chicago.
uses gw.api.database.Query
// Query the database for addresses in Chicago.
var findQuery = Query.make(Address).compare("City", Equals, "Chicago").select()
// Print the addresses in the query result.
for (a in findQuery) {
print (a.AddressLine1 + " / " + a.City + ", " + a.PostalCode)
}
See also
