public class HollowFieldMatchQuery
extends java.lang.Object
Results are returned in the form of a Map<String, BitSet>. Each type for which any records matched will have an entry in the returned Map, keyed by type name. The corresponding value is a BitSet which is set at the positions of the ordinals of the matched records.
Hint: The returned Map<String, BitSet> may be in turn passed to the TransitiveSetTraverser
to be augmented with any records
which reference matched records. For example, we can imagine a data model for which the following code would provide a
selection which includes the Actor record for "Tom Hanks", plus any Movie records in which he stars:
HollowFieldMatchQuery query = new HollowFieldMatchQuery(myStateEngine);
Map<String, BitSet> selection = query.findMatchingRecords("actorName", "Tom Hanks");
TransitiveSetTraverser.addReferencingOutsideClosure(myStateEngine, selection);
Constructor and Description |
---|
HollowFieldMatchQuery(HollowReadStateEngine readEngine) |
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.util.BitSet> |
findMatchingRecords(java.lang.String fieldName,
java.lang.String fieldValue)
Match any records which include a field with the provided fieldName and value.
|
java.util.Map<java.lang.String,java.util.BitSet> |
findMatchingRecords(java.lang.String typeName,
java.lang.String fieldName,
java.lang.String fieldValue)
Match any records of the specified type, which have the specified field set to the specified value.
|
public HollowFieldMatchQuery(HollowReadStateEngine readEngine)
public java.util.Map<java.lang.String,java.util.BitSet> findMatchingRecords(java.lang.String fieldName, java.lang.String fieldValue)
fieldName
- the field namefieldValue
- the field value as a string that will be parsed as the type of the field to match.public java.util.Map<java.lang.String,java.util.BitSet> findMatchingRecords(java.lang.String typeName, java.lang.String fieldName, java.lang.String fieldValue)
typeName
- the type namefieldName
- the field namefieldValue
- the field value as a string that will be parsed as the type of the field to match.