private ObjectQuery getAssociationsSearchQuery( PrismContext prismContext, PrismObject resource, QName objectClass, ShadowKindType kind, String intent) { try { ObjectFilter andFilter = AndFilter.createAnd( EqualFilter.createEqual( ShadowType.F_OBJECT_CLASS, ShadowType.class, prismContext, objectClass), EqualFilter.createEqual(ShadowType.F_KIND, ShadowType.class, prismContext, kind), // EqualFilter.createEqual(ShadowType.F_INTENT, ShadowType.class, // prismContext, intent), RefFilter.createReferenceEqual( new ItemPath(ShadowType.F_RESOURCE_REF), ShadowType.class, prismContext, resource.getOid())); ObjectQuery query = ObjectQuery.createObjectQuery(andFilter); return query; } catch (SchemaException ex) { LoggingUtils.logUnexpectedException(LOGGER, "Unable to create associations search query", ex); return null; } }