class %Identity.Link1ResultSet
extends %ResultSet.Custom
The Link1ResultSet class provides a %Library.IResultSet interface
to the Link1^%Identity.match extrinsic function. A class wrapper for the Link1 method is
documented in the class documentation of the %Identity.Data.Linkage class.
Example 1: Calling from Caché ObjectScript:
set searchFor = ##class(yourPackage.yourEntityClass).%New()
set searchFor.GivenName = givenName
set searchFor.Surname = surname
set searchFor.DateOfBirth = dateOfBirth
set rs = ##class(%ResultSet.Custom).%Prepare("%Identity.Link1ResultSet",.error,"",searchFor,linkageID,"",1,1)
while (rs.%Next(.sc))
{ w !,"[",rs.EntityID,",",rs.RowID,",",rs.Linkweight,",",rs.AgreePat,"]"
}
do rs.%CloseCursor()
QUIT
Example 2: Calling from Java
searchFor = yourPackage.yourEntityClass.%New();
searchFor.GivenName = givenName;
searchFor.Surname = surname;
searchFor.DateOfBirth = dateOfBirth;
rs = %ResultSet.Custom.%Prepare("%Identity.Link1ResultSet",error,"",searchFor,linkageID,"",1,1));
while (rs.next())
{ System.out.println( "[" + rs.EntityID + "," + rs.RowID + "," + rs.Linkweight + "," + rs.AgreePat + "]" );
}
rs.%CloseCursor()
Example 3: Calling from Perl
$url = "localhost[1972]:Samples"
$conn = Intersys::PERLBIND::Connection->new($url,"_SYSTEM","SYS",0);
$database = Intersys::PERLBIND::Database->new($conn);
$searchFor = $database->run_class_method("yourPackage.yourEntityClass","%New")
$searchFor->set("GivenName","Joan");
$searchFor->set("Surname","Doe");
$searchFor->set("dateOfBirth",61153);
rs =
while (@cols = $rs->fetch($sqlcode)) {
{ $line = "[".cols[1].",".cols[2].",".cols[3].",".cols[4]."]"
print "$line\n";
}
parameter ORDERBYENTITYID = 0;
Set the ORDERBYENTITYID to 1 to return results in EntityID order.
By default the output is returned in descending order of Linkweight.
method %CloseCursor()
as %Status
Clean up on destruct
method %Next(ByRef sc As %Library.Status)
as %Library.Integer
Advance the result set cursor to the next row. Returns 0 if the cursor is at the end of the
result set.