Found it myself:
for the absence
StructuredQueryDefinition query =
qb.and(qb.not(qb.containerConstraint("workUuid", qb.and(null))));
and the presence
StructuredQueryDefinition query = qb.and(qb.containerConstraint("workUuid",
qb.and(null)));
:) Klaus
From: [email protected]
[mailto:[email protected]] On Behalf Of Köhler, Klaus
Sent: Monday, April 20, 2015 2:25 PM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Absence of element
Hi,
in XQuery I can check the absence of an element with
cts:search(/product, cts:not-query(cts:element-query( xs:QName('workUuid'),
cts:and-query(()) )))
and the presence with
cts:search(/product, cts:element-query( xs:QName('workUuid'), cts:and-query(())
))
Is there a way to express this through the Java Api?
Thx
Klaus Köhler
Software Architekt
Klopotek & Partner GmbH
Schlüterstraße 39
10629 Berlin
Tel. + 49 30.884 53-204
Fax + 49 30.884 53-100
mailto:[email protected]
http://www.klopotek.de
Geschäftsführung:
Ulrich Klopotek von Glowczewski (Vorsitzender)
Stefan Jacob, Wolf-Michael Mehl
AG Charlottenburg HRB 45287
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen.
Wenn Sie nicht der richtige Adressat sind, informieren Sie bitte sofort den
Absender und vernichten diese E-Mail. Das Kopieren oder die Weitergabe der
E-Mail ist in diesem Fall nicht gestattet. Aufgrund der technischen
Gegebenheiten im Internet ist nicht auszuschließen, dass diese Nachricht auf
dem Weg zu Ihnen gelesen oder verfälscht worden ist. Fachliche Ausführungen in
E-Mails und/oder Anlagen dazu haben grundsätzlich Entwurfscharakter und
bedürfen unserer schriftlichen Bestätigung.
This e-mail may contain confidential and/or privileged information. If you are
not the intended recipient please notify the sender immediately and destroy
this e-mail. In this case any copy, disclosure or distribution of the material
in this e-mail is strictly forbidden. Due to the technical structures of the
Internet, this message may have been scanned or faked on its way to you.
Professional statements within an e-mail and/or attachments to an e-mail are to
be regarded as drafts and require our written confirmation.
_______________________________________________
General mailing list
[email protected]
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general