A computer program product for use with a computer system to perform a search of a virtual repository formed from a plurality of repositories, each repository of the virtual repository being associated with a separate database system, the computer program product comprising a computer useable medium having embodied therein program code comprising:
- program code for receiving a string-based search expression;
- program code for generating an expression tree of nodes based on the string-based search expression, one or more of the nodes of the expression tree being an attribute node, each attribute node corresponding to an attribute included in the string-based search expression;
- and
- program code for adding repository-location information to the expression tree by associating metadata with each attribute node in the expression tree, the metadata associated with a given attribute node identifying one or more repositories that support the attribute represented by that attribute node, each repository of the plurality of repositories being identified by the metadata associated with the one or more attribute nodes;
- program code for generating for each repository identified by the metadata associated with the one or more attribute nodes a query expression specifically for that repository based on the string-based search expression;
- program code for searching each repository identified by the metadata associated with the one or more attribute nodes using the query expression specifically generated for that repository and
- program code for determining whether sub-trees of a particular node of the expression tree have attribute nodes associated with metadata identifying different sets of repositories, and, if the metadata associated with the attribute nodes identify different sets of repositories, program code for constructing the particular node as a federation node to merge search results returned by the sub-trees.