@Override public ItemPathSegment clone() { return new ParentPathSegment(); }
@Override public boolean equivalent(Object obj) { return equals(obj); }
public static ItemPathSegment createSegment(QName qname, boolean variable) { if (ParentPathSegment.QNAME.equals(qname)) { return new ParentPathSegment(); } else if (ObjectReferencePathSegment.QNAME.equals(qname)) { return new ObjectReferencePathSegment(); } else if (IdentifierPathSegment.QNAME.equals(qname)) { return new IdentifierPathSegment(); } else if (variable) { return new VariableItemPathSegment(qname); } else { return new NameItemPathSegment(qname); } }
@Test public void test700Exists() throws Exception { final String TEST_NAME = "test700Exists"; displayTestTitle(TEST_NAME); PrismReferenceValue ownerRef = ObjectTypeUtil.createObjectRef("1234567890", ObjectTypes.USER).asReferenceValue(); ObjectQuery q = getPrismContext().queryFor(AccessCertificationCaseType.class) .exists(new ParentPathSegment()) // if using T_PARENT then toString representation of paths is different .block() .id(123456L) .or().item(F_OWNER_REF).ref(ownerRef) .endBlock() .and().exists(AccessCertificationCaseType.F_WORK_ITEM) .item(AccessCertificationWorkItemType.F_STAGE_NUMBER).eq(3) .build(); checkQueryRoundtripFile(AccessCertificationCaseType.class, q, TEST_NAME); }