Class ObjectQueryUtil
- java.lang.Object
-
- com.evolveum.midpoint.schema.util.ObjectQueryUtil
-
public class ObjectQueryUtil extends Object
-
-
Constructor Summary
Constructors Constructor Description ObjectQueryUtil()
-
Method Summary
-
-
-
Method Detail
-
createNameQuery
public static ObjectQuery createNameQuery(String name, PrismContext prismContext) throws SchemaException
- Throws:
SchemaException
-
createOrigNameQuery
public static ObjectQuery createOrigNameQuery(String name, PrismContext prismContext)
-
createNameQuery
public static ObjectQuery createNameQuery(PolyStringType name, PrismContext prismContext) throws SchemaException
- Throws:
SchemaException
-
createNameQuery
public static ObjectQuery createNameQuery(PolyString name, PrismContext prismContext) throws SchemaException
- Throws:
SchemaException
-
createOidQuery
public static <O extends ObjectType> ObjectQuery createOidQuery(PrismObject<O> object) throws SchemaException
- Throws:
SchemaException
-
createOidQuery
public static ObjectQuery createOidQuery(String oid, PrismContext prismContext)
-
createOrigNameQuery
public static ObjectQuery createOrigNameQuery(PolyString name, PrismContext prismContext)
-
createNormNameQuery
public static ObjectQuery createNormNameQuery(PolyString name, PrismContext prismContext)
-
createNameQuery
public static ObjectQuery createNameQuery(ObjectType object) throws SchemaException
- Throws:
SchemaException
-
createNameQuery
public static <O extends ObjectType> ObjectQuery createNameQuery(PrismObject<O> object) throws SchemaException
- Throws:
SchemaException
-
createResourceAndObjectClassQuery
public static ObjectQuery createResourceAndObjectClassQuery(String resourceOid, QName objectClass, PrismContext prismContext)
-
createResourceAndObjectClassFilter
public static ObjectFilter createResourceAndObjectClassFilter(String resourceOid, QName objectClass, PrismContext prismContext)
-
createResourceAndObjectClassFilterPrefix
public static S_AtomicFilterExit createResourceAndObjectClassFilterPrefix(String resourceOid, QName objectClass, PrismContext prismContext) throws SchemaException
- Throws:
SchemaException
-
createResourceAndKindIntent
public static ObjectQuery createResourceAndKindIntent(String resourceOid, ShadowKindType kind, String intent, PrismContext prismContext) throws SchemaException
- Throws:
SchemaException
-
createResourceAndKind
public static ObjectQuery createResourceAndKind(String resourceOid, ShadowKindType kind, PrismContext prismContext) throws SchemaException
- Throws:
SchemaException
-
createResourceAndKindIntentFilter
public static ObjectFilter createResourceAndKindIntentFilter(String resourceOid, ShadowKindType kind, String intent, PrismContext prismContext)
-
createResourceQuery
public static ObjectQuery createResourceQuery(String resourceOid, PrismContext prismContext)
-
createResourceFilter
public static ObjectFilter createResourceFilter(String resourceOid, PrismContext prismContext)
-
createObjectClassFilter
public static ObjectFilter createObjectClassFilter(QName objectClass, PrismContext prismContext)
-
createNameQuery
public static <T extends ObjectType> ObjectQuery createNameQuery(Class<T> clazz, PrismContext prismContext, String name) throws SchemaException
- Throws:
SchemaException
-
createRootOrgQuery
public static ObjectQuery createRootOrgQuery(PrismContext prismContext)
-
hasAllDefinitions
public static boolean hasAllDefinitions(ObjectQuery query)
-
hasAllDefinitions
public static boolean hasAllDefinitions(ObjectFilter filter)
-
assertPropertyOnly
public static void assertPropertyOnly(ObjectFilter filter, String message)
-
assertNotRaw
public static void assertNotRaw(ObjectFilter filter, String message)
-
dump
public static String dump(QueryType query, @NotNull @NotNull PrismContext prismContext) throws SchemaException
- Throws:
SchemaException
-
filterAnd
public static ObjectFilter filterAnd(ObjectFilter origFilter, ObjectFilter additionalFilter, PrismContext prismContext)
Merges the two provided arguments into one AND filter in the most efficient way. *Please note: If provided `origFilter` isAndFilter
it will be modified!* TODO consider moving to QueryFactory
-
filterAndImmutable
public static ObjectFilter filterAndImmutable(@Nullable @Nullable ObjectFilter origFilter, @Nullable @Nullable ObjectFilter additionalFilter)
Merges the two provided arguments into one AND filter in an immutable way. If provided `origFilter` isAndFilter
, it will be cloned first, then modified. Although input objects are not changed, there is no guarantee that new object is always returned. For many simple and/or corner cases one of the parameters may be returned, so it may not be safe to mutate the returned value. TODO consider moving to QueryFactory
-
filterOr
public static ObjectFilter filterOr(ObjectFilter origFilter, ObjectFilter additionalFilter, PrismContext prismContext)
Merges the two provided arguments into one OR filter in the most efficient way. *Please note: If provided `origFilter` isOrFilter
it will be modified!* TODO consider moving to QueryFactory
-
filterOrImmutable
public static ObjectFilter filterOrImmutable(ObjectFilter origFilter, ObjectFilter additionalFilter)
Merges the two provided arguments into one OR filter in an immutable way. If provided `origFilter` isOrFilter
, it will be cloned first, then modified. Although input objects are not changed, there is no guarantee that new object is always returned. For many simple and/or corner cases one of the parameters may be returned, so it may not be safe to mutate the returned value. TODO consider moving to QueryFactory
-
isAll
public static boolean isAll(ObjectFilter filter)
-
isNone
public static boolean isNone(ObjectFilter filter)
-
simplify
public static ObjectFilter simplify(ObjectFilter filter, PrismContext prismContext)
Returns ALL, NONE only at the top level (never inside the filter), never returns UNDEFINED. This always returns cloned filter which can be freely modify later.
-
getCoordinates
public static ResourceShadowDiscriminator getCoordinates(ObjectFilter filter, PrismContext prismContext) throws SchemaException
- Throws:
SchemaException
-
createReferences
public static List<PrismReferenceValue> createReferences(String oid, RelationKindType kind, RelationRegistry relationRegistry)
-
createReferences
public static List<PrismReferenceValue> createReferences(Collection<String> oids, RelationKindType kind, RelationRegistry relationRegistry)
-
addConjunctions
public static ObjectQuery addConjunctions(ObjectQuery query, ObjectFilter... newConjunctionMembers)
-
addConjunctions
public static ObjectQuery addConjunctions(ObjectQuery query, PrismContext prismContext, ObjectFilter... newConjunctionMembers)
-
addConjunctions
public static ObjectQuery addConjunctions(ObjectQuery query, PrismContext prismContext, Collection<ObjectFilter> newConjunctionMembers)
-
hasFilter
public static boolean hasFilter(ObjectQuery query)
-
replaceFilter
@NotNull public static @NotNull ObjectQuery replaceFilter(ObjectQuery original, ObjectFilter newFilter)
-
convertToObjectPaging
public static ObjectPaging convertToObjectPaging(PagingType pagingType, PrismContext prismContext)
-
-